Examples: IsPublicAddressBook property

This agent retrieves the current user Domino® Directories and Personal Address Books, and prints a message for each one that is a Domino® Directory.

import lotus.domino.*;
import java.util.*;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      // (Your code goes here) 
      System.out.println("Domino Directories:\n");
      Vector books = session.getAddressBooks();
      Enumeration e = books.elements();
      Database db;
      while (e.hasMoreElements()) {
        db = (Database)e.nextElement();
        if (db.isPublicAddressBook()) {
          String msg = "  " + db.getFilePath();
          if (db.getServer() != "")
            msg = msg + " on " + db.getServer();
          System.out.println(msg); }}
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}