Reputation: 1395
I have to implement an client application that need to sync IMAP messages. But currently IMAP server that store messages are not ready yet and i need to finish my task. So i am using to Gmail for testing my implementation of retrieving IMAP messages.
I simulate what the spec said for the folder structures in Gmail. Creating folder and subfolders.
/Default
/Default/User1/Session1
/Default/User1/Session1/File1
/Default/User1/Session2
/Default/User2/Session1
/Default/User3
Then i use java mail to list out the folders under default.
store.getFolder("Default").list("*");
I loop the folder to print out the folder count and folder name. The returned folder includes all the subfolders of each User like above.
I would like to know is this the way that IMAP server return for the folder list query? all the subfolders under it?
Upvotes: 0
Views: 666
Reputation: 29971
If you use list(*"), yes. If you only want one level use list("%"). This is well explained in the javadocs.
Upvotes: 1