public class SerialisableAttachmentDataSource
extends java.lang.Object
implements javax.activation.DataSource
SerialisableAttachment in a DataSource to allow for
easily attaching to messages created with Commons Mail. Name, content and content type will be
taken over, getOutputStream() will not work since writing to an attachment does not make
sense – at least at the time this data source is being used.| Modifier and Type | Field and Description |
|---|---|
protected SerialisableAttachment |
att
The wrapped serialisable attachment.
|
| Constructor and Description |
|---|
SerialisableAttachmentDataSource(SerialisableAttachment att)
Creates a new wrapper for a
SerialisableAttachment. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContentType() |
java.io.InputStream |
getInputStream() |
java.lang.String |
getName() |
java.io.OutputStream |
getOutputStream() |
protected final SerialisableAttachment att
public SerialisableAttachmentDataSource(SerialisableAttachment att)
SerialisableAttachment.att - The wrapped serialisable attachment.public java.lang.String getName()
getName in interface javax.activation.DataSourcepublic java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface javax.activation.DataSourcejava.io.IOException