Interface EMailAttachment

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getContentType()
      Retrieves the content type for this attachment.
      byte[] getData()
      Retrieves the raw data for this attachment.
      java.lang.String getDisposition()
      Retrieves the disposition for this attachment.
      java.io.InputStream getInputStream()
      Retrieves an input stream that can be used to read the attachment data.
      java.lang.String getName()
      Retrieves the filename for this attachment.
      java.io.OutputStream getOutputStream()
      Throws an IOException to indicate that it is not possible to write to this data source.
      boolean isInline()
      Indicates whether this attachment should have a disposition of "inline" rather than "attachment".
      java.lang.String toString()
      Retrieves a string representation of this email attachment.
    • Method Detail

      • getName

        java.lang.String getName()
        Retrieves the filename for this attachment.
        Specified by:
        getName in interface javax.activation.DataSource
        Returns:
        The filename for this attachment.
      • getContentType

        java.lang.String getContentType()
        Retrieves the content type for this attachment. Note that it may have been altered from the provided value (for example, to add the filename to it).
        Specified by:
        getContentType in interface javax.activation.DataSource
        Returns:
        The content type for this attachment.
      • isInline

        boolean isInline()
        Indicates whether this attachment should have a disposition of "inline" rather than "attachment".
        Returns:
        true if this attachment should have a disposition of "inline", or false if this attachment should have a disposition of "attachment".
      • getDisposition

        java.lang.String getDisposition()
        Retrieves the disposition for this attachment. It will be one of "inline" or "attachment", based on the return value of isInline().
        Returns:
        The disposition for this attachment.
      • getData

        byte[] getData()
        Retrieves the raw data for this attachment. The content of the returned array must not be altered by the caller.
        Returns:
        The raw data for this attachment.
      • getInputStream

        java.io.InputStream getInputStream()
        Retrieves an input stream that can be used to read the attachment data.
        Specified by:
        getInputStream in interface javax.activation.DataSource
        Returns:
        An input stream that can be used to read the attachment data.
      • getOutputStream

        java.io.OutputStream getOutputStream()
                                      throws java.io.IOException
        Throws an IOException to indicate that it is not possible to write to this data source.
        Specified by:
        getOutputStream in interface javax.activation.DataSource
        Returns:
        Nothing, because this method always throws an exception.
        Throws:
        java.io.IOException - To indicate that it is not possible to write to this data source.
      • toString

        java.lang.String toString()
        Retrieves a string representation of this email attachment.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this email attachment.