Interface AttachmentDataSource

All Superinterfaces:
jakarta.activation.DataSource, com.novomind.ecom.common.api.attribute.Named, com.novomind.ecom.common.api.io.datasource.SizedDataSource
All Known Subinterfaces:
MessageAttachmentDataSource

public interface AttachmentDataSource extends com.novomind.ecom.common.api.io.datasource.SizedDataSource, com.novomind.ecom.common.api.attribute.Named
An AttachmentDataSource provides information and access to the binary data of an attachment.
Since:
10.0.38
  • Method Summary

    Modifier and Type
    Method
    Description
     
    default OutputStream
    This method maybe unsupported and throws a RuntimeException

    Methods inherited from interface jakarta.activation.DataSource

    getContentType, getName

    Methods inherited from interface com.novomind.ecom.common.api.attribute.Named

    getName

    Methods inherited from interface com.novomind.ecom.common.api.io.datasource.SizedDataSource

    getSize
  • Method Details

    • getInputStream

      InputStream getInputStream() throws AttachmentIOException
      Specified by:
      getInputStream in interface jakarta.activation.DataSource
      Returns:
      InputStream - the binary attachment data
      Throws:
      AttachmentIOException - if an error occurred on accessing the attachment
      Since:
      10.0.38
    • getOutputStream

      default OutputStream getOutputStream() throws IOException
      This method maybe unsupported and throws a RuntimeException
      Specified by:
      getOutputStream in interface jakarta.activation.DataSource
      Returns:
      OutputStream - OutputStream to write the attachment binary data
      Throws:
      IOException - if an error occurred on writing the attachment data
      Since:
      10.0.38