将 Exchange 文件夹分类为杰出文件夹和普通文件夹

发布于 2024-09-08 01:35:42 字数 1205 浏览 1 评论 0原文

我的问题是,当我尝试使用 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);

我看不到任何可以区分这些文件夹的属性2 种文件夹。

谢谢

My question is how to make difference between a distinguished folders and a folder created by user when I try to obtain the list of user folders using findFolder web service method:

    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);

I can not see any property to distinct between these 2 types of folders.

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青丝拂面 2024-09-15 01:35:43

来自 http://social.technet.microsoft.com/Forums/exchange/en-US/57551bd1-d1e1-4913-bbb2-e2abbca02a3f/如何区分用户创建的文件夹和所有消息文件夹?forum=exchangesvrdevelopment

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

From 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:

"Call GetFolder (IdOnly) and pass in all the enumeration values from DistinguishedFolderIdNamesType and stick the resulting FolderIds in a dictionary (FolderId.Id to Enum). Then when you want to see if a given Folder is "distinguished" or not, just check to see if the key exists in your dictionary."

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文