Class Attachment


  • public class Attachment
    extends Object
    Defines an attachment.

    Instances of this class are not thread-safe.

    • Constructor Detail

      • Attachment

        public Attachment​(String name,
                          File file,
                          String contentType)
        Creates a new Attachment. Disposition is set to attachment.
        Parameters:
        name - the name
        file - the file
        contentType - the content type
      • Attachment

        public Attachment​(String name,
                          File file,
                          String contentType,
                          String contentId)
        Creates a new Attachment. Disposition is set to inline.
        Parameters:
        name - the name
        file - the file
        contentType - the content type
        contentId - the content id
      • Attachment

        public Attachment​(String name,
                          byte[] data,
                          String contentType)
        Creates a new Attachment. Disposition is set to attachment.
        Parameters:
        name - the name
        data - the data
        contentType - the content type
      • Attachment

        public Attachment​(String name,
                          org.reactivestreams.Publisher<Byte> data,
                          String contentType)
        Creates a new Attachment. Disposition is set to attachment.
        Parameters:
        name - the name
        data - the data as a stream of Byte
        contentType - the content type
      • Attachment

        public Attachment​(String name,
                          byte[] data,
                          String contentType,
                          String contentId)
        Creates a new Attachment. Disposition is set to inline.
        Parameters:
        name - the name
        data - the data
        contentType - the content type
        contentId - the content id
      • Attachment

        public Attachment​(String name,
                          org.reactivestreams.Publisher<Byte> data,
                          String contentType,
                          String contentId)
        Creates a new Attachment. Disposition is set to inline.
        Parameters:
        name - the name
        data - the data as a stream of Byte
        contentType - the content type
        contentId - the content id
      • Attachment

        public Attachment​(String name,
                          byte[] data,
                          String contentType,
                          String description,
                          String disposition)
        Creates a new Attachment.
        Parameters:
        name - the name
        data - the data
        contentType - the content type
        description - the description
        disposition - the disposition
      • Attachment

        public Attachment​(String name,
                          org.reactivestreams.Publisher<Byte> data,
                          String contentType,
                          String description,
                          String disposition)
        Creates a new Attachment.
        Parameters:
        name - the name
        data - the data as a stream of Byte
        contentType - the content type
        description - the description
        disposition - the disposition
    • Method Detail

      • getName

        public String getName()
      • getFile

        public File getFile()
      • getDescription

        public String getDescription()
      • getDisposition

        public String getDisposition()
      • getData

        public org.reactivestreams.Publisher<Byte> getData()
      • setData

        public Attachment setData​(byte[] data)
      • setData

        public Attachment setData​(org.reactivestreams.Publisher<Byte> data)
      • getContentType

        public String getContentType()
      • getContentId

        public String getContentId()
      • isInlineAttachment

        public boolean isInlineAttachment()
        Returns:
        true if the disposition is set to inline.