How can I access inbox and other folders/objects inside my Domino server using Java APIs?
I'm not sure where your code is running, but the Java API is basically the same regardless. Once you are set up with a lotus.domino.Session object, you first have to locate the user's mail file.
DbDirectory dir = session.getDbDirectory(null); Database db = dir.openMailDatabase();
Then, use the Database..getView method to locate the inbox folder:
View inbox = db.getView("($Inbox)")
Inbox and a couple of other built-in folders have a special name. If you're not sure of the name of the folder you want to find, open the database in Domino Designer and look at how the folder naming scheme goes. To scan through all the folders, you can use Database..getViews to get all the views and iterate through them looking for folders.
However, this is somewhat inefficient since each view will have its index updated when you load its View object, which is work that didn't need doing. You can also find all the Folder design notes using a NoteCollection with a selection formula. There's a function at this URL which shows how to do this.
This is a good answer, but I'm not sure that was the question asked. I'm betting that the actual question here meant "folders" = "subdirectories".
Do you have comments on this Ask the Expert question and response? Let us know.
Dig Deeper on Java for Lotus Notes Domino
Related Q&A from Andre Guirard
Learn how you can use LotusScript and OLE to create and populate Microsoft Excel spreadsheets, as well as a little bit about Lotus Symphony. Continue Reading
Discover options you can use if you'd like external users to be able to access a workflow-based Notes Domino application through different ... Continue Reading
Learn why you may receive the error message: "Illegal circular use: Audit Trail" when trying to open Lotus Notes documents that use copied forms. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.