我试图获取 Office365 的联系人。但是两个联系人列表名称和联系人都得到相同的结果。如何分别获取联系人列表名称和联系人。
我的代码:
Folder folder = Folder.bind(service, WellKnownFolderName.Contacts);
ItemView view = new ItemView(10);
FindItemsResults findResults = service.findItems(folder.getId(), view);
System.out.println(" Resulting Size : "+ findResults.getTotalCount());
for (Item item : findResults.getItems()) {
try {
System.out.println("id:" + item.getId());
System.out.println("sub==========" + item.getSubject());
} catch (Exception e) {
System.out.println("Exception while processing");
}
}
结果:
结果大小:12
id:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwzAAA= sub==========Prem Contact List id:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwyAAA= sub==========Ramesh Agile List id:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwxAAA= sub========= =dshvbisdjkbv id:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwid==wAAA=bvd==子=AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwvAAA= sub==========jobing id:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwuAAA= sub==========pisting id:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwtAAA= sub==========non id:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwsAAA=子==========相同的ID:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwrAAA= sub==========Mani Rathnam id:AAMkADkzMDQ5MmUzLTAyMDItNDNjOC04OTBmLWI5ZjhkYzMyYzdhMQBGAAAAAACpdp4753ORRZhtspSlk0QkBwDFMCvQ3WnzRp46NKMcZvtLAAAAAAEOAADFMCvQ3WnzRp46NKMcZvtLAAAVhBwqAAA= sub==========enc