Class Attachment

java.lang.Object
de.espirit.firstspirit.access.Attachment

public class Attachment extends Object
Container for transporting attachments.
Since:
4.0
  • Constructor Details

    • Attachment

      public Attachment(File file) throws FileNotFoundException
      File-based constructor for an attachment.
      Parameters:
      file - The file providing the attachment.
      Throws:
      FileNotFoundException - if the given file could not be accessed.
      Since:
      4.0
    • Attachment

      public Attachment(String name, InputStream stream)
      Stream-based constructor for an attachment also providing a name.
      Parameters:
      name - name of the attachement (also used to determine the mime type of the attachement)
      stream - content of the attachment
      Since:
      4.0
    • Attachment

      public Attachment(String name, @Nullable @Nullable String type, InputStream stream)
      Stream-based constructor for an attachment, additionally providing a name and a type for the file.
      Parameters:
      name - The name to be used for the attachment.
      type - The mime type to be used for the attachment.
      stream - The stream containing the data.
      Since:
      4.0
  • Method Details

    • getStream

      public InputStream getStream()
      Provides access to the attachment's stream.
      Returns:
      The stream handle.
      Since:
      4.0
    • getName

      public String getName()
      Provides the attachment's name.
      Returns:
      The name.
      Since:
      4.0
    • getType

      public String getType()
      Provides the attachment's type.
      Returns:
      The type.
      Since:
      4.0