public class DataSourceAttachment extends SerialisableAttachment
SerialisableAttachment having a datasource as content. If this attachment is
serialised, it will become a ByteArrayDataSource.| Modifier and Type | Field and Description |
|---|---|
protected javax.activation.DataSource |
dataSource
The data source providing the content.
|
contentType, description, inlineName, name| Constructor and Description |
|---|
DataSourceAttachment(javax.activation.DataSource dataSource,
java.lang.String description)
Creates an attachment having the designated data source (content, name and content type).
|
DataSourceAttachment(javax.activation.DataSource dataSource,
java.lang.String description,
boolean inline)
Creates an attachment having the designated data source (content, name and content type).
|
DataSourceAttachment(javax.activation.DataSource dataSource,
java.lang.String description,
java.lang.String inlineName)
Creates an attachment having the designated data source (content, name and content type).
|
DataSourceAttachment(java.lang.String name,
java.lang.String description,
javax.activation.DataSource dataSource)
Creates an attachment having the designated name and description retrieving the content from
the designated data source.
|
DataSourceAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
javax.activation.DataSource dataSource)
Creates an attachment having the designated name, description and content type retrieving the
content from the designated data source.
|
DataSourceAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
javax.activation.DataSource dataSource,
boolean inline)
Creates an attachment having the designated name, description and content type retrieving the
content from the designated data source.
|
DataSourceAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
javax.activation.DataSource dataSource,
java.lang.String inlineName)
Creates an attachment having the designated name, description and content type retrieving the
content from the designated data source.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getContent()
Gets the content of the attachment represented as
InputStream. |
getContentType, getDescription, getInlineName, getNameprotected final javax.activation.DataSource dataSource
public DataSourceAttachment(java.lang.String name,
java.lang.String description,
javax.activation.DataSource dataSource)
name - The name of the attachment.description - The description of the attachment.dataSource - The data source providing the content (only).public DataSourceAttachment(javax.activation.DataSource dataSource,
java.lang.String description)
dataSource - The data source providing the content (and the name and the content type).description - The description of the attachment.public DataSourceAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
javax.activation.DataSource dataSource)
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.dataSource - The data source providing the content (only).public DataSourceAttachment(javax.activation.DataSource dataSource,
java.lang.String description,
boolean inline)
dataSource - The data source providing the content (and the name and the content type).description - The description of the attachment.inline - Whether to inline this attachment in case of an HTML message using the designated
name.public DataSourceAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
javax.activation.DataSource dataSource,
boolean inline)
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.dataSource - The data source providing the content (only).inline - Whether to inline this attachment in case of an HTML message using the designated
name.public DataSourceAttachment(javax.activation.DataSource dataSource,
java.lang.String description,
java.lang.String inlineName)
dataSource - The data source providing the content (and the name and the content type).description - The description of the attachment.inlineName - The name used in the corresponding HTML message to refer to this attachment
to be inlined. Use null to not inline the attachment.public DataSourceAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
javax.activation.DataSource dataSource,
java.lang.String inlineName)
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.dataSource - The data source providing the content (only).inlineName - The name used in the corresponding HTML message to refer to this attachment
to be inlined. Use null to not inline the attachment.public java.io.InputStream getContent()
throws java.io.IOException
SerialisableAttachmentInputStream. InputStream cannot be serialised.getContent in class SerialisableAttachmentjava.io.IOException - If there are problems retrieving the content, for
instance converting the transferred serialisable data to an
InputStream, an IOException will be
thrown.