Examples: IsEncrypted property

This agent displays whether the current document is encrypted.

import lotus.domino.*;
import java.util.Vector;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here)
      DocumentCollection dc = agentContext.getUnprocessedDocuments();
      Document doc = dc.getFirstDocument();
      String subject = doc.getItemValueString("Subject");
      if (doc.isEncrypted())
        System.out.println("Encrypted: " + subject);
      else
        System.out.println("Not encrypted: " + subject);

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}