gpt4 book ai didi

java - 将 Exchange 文件夹分类为可分辨文件夹和普通文件夹

转载 作者:行者123 更新时间:2023-12-04 03:59:58 25 4
gpt4 key购买 nike

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

我看不到任何区分这两种类型文件夹的属性。

谢谢

最佳答案

来自 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."

关于java - 将 Exchange 文件夹分类为可分辨文件夹和普通文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3132895/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com