Examples: DbDirectory class

This agent prints the file name and title of every database in the local directory.

import lotus.domino.*;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      DbDirectory dir = session.getDbDirectory(null);
      String server = dir.getName();
      if (server.equals("")) server = "Local";
      System.out.println ("Database directory list on server " 
         + server + "\n");
      Database db = dir.getFirstDatabase(DbDirectory.DATABASE);
      while (db != null) {
        String fn = db.getFileName();
        String title = db.getTitle();
        System.out.println(fn.toUpperCase() + " - " + title);
        db = dir.getNextDatabase(); }
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}