Interface Attachment


public interface Attachment
Represents an attachment to a MimeMessage
Since:
1.0.0
Author:
Arjen Poutsma
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the content identifier of the attachment.
    Returns the content type of the attachment.
    jakarta.activation.DataHandler
    Returns the data handler of the attachment.
    Return an InputStream to read the contents of the attachment from.
    long
    Returns the size of the attachment in bytes.
  • Method Details

    • getContentId

      String getContentId()
      Returns the content identifier of the attachment.
      Returns:
      the content id, or null if empty or not defined
    • getContentType

      String getContentType()
      Returns the content type of the attachment.
      Returns:
      the content type, or null if empty or not defined
    • getInputStream

      InputStream getInputStream() throws IOException
      Return an InputStream to read the contents of the attachment from. The user is responsible for closing the stream.
      Returns:
      the contents of the file as stream, or an empty stream if empty
      Throws:
      IOException - in case of access I/O errors
    • getSize

      long getSize()
      Returns the size of the attachment in bytes. Returns -1 if the size cannot be determined.
      Returns:
      the size of the attachment, 0 if empty, or -1 if the size cannot be determined
    • getDataHandler

      jakarta.activation.DataHandler getDataHandler()
      Returns the data handler of the attachment.
      Returns:
      the data handler of the attachment