3

findFolder我的问题是,当我尝试使用Web 服务方法获取用户文件夹列表时,如何区分区分文件夹和用户创建的文件夹:

    FindFolderType request = new FindFolderType();

    request.setTraversal(FolderQueryTraversalType.DEEP);

    FolderResponseShapeType folderResponseShapeType = new FolderResponseShapeType();
    folderResponseShapeType.setBaseShape(DefaultShapeNamesType.ALL_PROPERTIES);
    request.setFolderShape(folderResponseShapeType);

    NonEmptyArrayOfBaseFolderIdsType folderIds = new NonEmptyArrayOfBaseFolderIdsType();
    DistinguishedFolderIdType folderId = new DistinguishedFolderIdType();
    folderId.setId(DistinguishedFolderIdNameType.MSGFOLDERROOT);
    folderIds.getFolderIdOrDistinguishedFolderId().add(folderId);
    request.setParentFolderIds(folderIds);

    //response
    Holder<FindFolderResponseType> findFolderResult = new Holder<FindFolderResponseType>();

    addHandlers(port);

    port.findFolder(
            request,
            getImpersonation(smtpAddress),
            getSerializedSecurityContextType(),
            MAILBOX_CULTURE,
            getServerVersion(),
            findFolderResult,
            serverVersion);

我看不到这两种类型的文件夹之间有任何区别。

谢谢

4

1 回答 1

0

来自http://social.technet.microsoft.com/Forums/exchange/en-US/57551bd1-d1e1-4913-bbb2-e2abbca02a3f/how-do-i-distinguish-the-user-create-folders-from-all -the-msgfolders?forum=exchangesvrdevelopment

“调用 GetFolder (IdOnly) 并传入 DistinguishedFolderIdNamesType 中的所有枚举值,并将生成的 FolderIds 粘贴在字典中(FolderId.Id 到 Enum)。然后,当您想查看给定文件夹是否“可区分”时,只需检查查看该键是否存在于您的字典中。”

于 2014-03-13T07:15:33.543 回答