Class AttachmentHandlingHelper

java.lang.Object
com.levigo.jadice.web.server.util.AttachmentHandlingHelper

public class AttachmentHandlingHelper extends Object
The AttachmentHandlingHelper class provides utilities to extract and handle attachments embedded in documents, given an input stream and a URI source. It supports extracting the attachment stream, determining the attachment name from a URI, and accessing document attachment metadata.

This class is primarily responsible for extracting embedded file attachments from documents, based on the URI provided in the source. It includes logic to read the document, locate the attachment, and return the corresponding stream if the attachment is found.

Example usage:

 
   AttachmentHandlingHelper helper = new AttachmentHandlingHelper();
   SeekableInputStream attachmentStream = helper.getAttachmentStream(inputStream, uriSource);
 
 

This class is thread-safe as all critical methods are synchronized.

See Also:
  • Document
  • Attachments
  • SeekableInputStream
  • Constructor Details

    • AttachmentHandlingHelper

      public AttachmentHandlingHelper()
  • Method Details

    • getAttachmentStream

      public com.levigo.jadice.document.io.SeekableInputStream getAttachmentStream(InputStream documentStream, UriSource source) throws IOException, com.levigo.jadice.document.JadiceException
      Throws:
      IOException
      com.levigo.jadice.document.JadiceException
    • getAttachmentValue

      public String getAttachmentValue(String url) throws URISyntaxException
      Throws:
      URISyntaxException
    • getAttachmentStream

      public com.levigo.jadice.document.io.SeekableInputStream getAttachmentStream(InputStream documentStream, UriHandle handle) throws IOException, com.levigo.jadice.document.JadiceException
      Throws:
      IOException
      com.levigo.jadice.document.JadiceException