public class Attachment extends Object
Constructor and Description |
---|
Attachment(File file)
File-based constructor for an attachment.
|
Attachment(String name,
InputStream stream)
Stream-based constructor for an attachment also providing a name.
|
Attachment(String name,
String type,
InputStream stream)
Stream-based constructor for an attachment, additionally providing a name and a type for the file.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Provides the attachment's name.
|
InputStream |
getStream()
Provides access to the attachment's stream.
|
String |
getType()
Provides the attachment's type.
|
public Attachment(File file) throws FileNotFoundException
file
- The file providing the attachment.FileNotFoundException
- if the given file could not be accessed.public Attachment(String name, InputStream stream)
name
- name of the attachement (also used to determine the mime type of the attachement)stream
- content of the attachmentpublic Attachment(String name, @Nullable String type, InputStream stream)
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.public InputStream getStream()
public String getName()
public String getType()
Copyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210