Article For
4.1 4.2 5.0 5.2

Session: How to Check if an Attachment Exists

  • To check whether a document contains a certain attachment, use the method exists() from the session.advanced().attachments() operations.

  • This does not load the document or the attachment from the server, and it does not cause the session to track the document.

  • In this page:


boolean exists(String documentId, String name);
Parameter Type Description
documentId String The ID of the document you want to check for the attachment
name String The name of the attachment you want to check the document for
Return Value Description
boolean Indicates if a document with the specified ID exists in the database


boolean exists = session

if (exists) {
    // do something