Package de.espirit.firstspirit.access
Class Attachment
java.lang.Object
de.espirit.firstspirit.access.Attachment
Container for transporting attachments.
- Since:
- 4.0
-
Constructor Summary
ConstructorDescriptionAttachment
(File file) File-based constructor for an attachment.Attachment
(String name, @Nullable String type, InputStream stream) Stream-based constructor for an attachment, additionally providing a name and a type for the file.Attachment
(String name, InputStream stream) Stream-based constructor for an attachment also providing a name. -
Method Summary
-
Constructor Details
-
Attachment
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
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
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
Provides access to the attachment's stream.- Returns:
- The stream handle.
- Since:
- 4.0
-
getName
Provides the attachment's name.- Returns:
- The name.
- Since:
- 4.0
-
getType
Provides the attachment's type.- Returns:
- The type.
- Since:
- 4.0
-