public abstract class SerialisableAttachment
extends java.lang.Object
implements java.io.Serializable
MailService. Mail attachments
have a name, a description, a content type (MIME) and binary content. The
content can be represented arbitrarily. MailService.| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
contentType
The content type (MIME) of the attachment.
|
protected java.lang.String |
description
The description of the attachment.
|
protected java.lang.String |
inlineName
The name used in the corresponding HTML message to refer to this attachment.
|
protected java.lang.String |
name
The name of the attachment.
|
| Modifier | Constructor and Description |
|---|---|
protected |
SerialisableAttachment(java.lang.String name,
java.lang.String description)
Creates an attachment having the designated name and description.
|
protected |
SerialisableAttachment(java.lang.String name,
java.lang.String description,
boolean inline)
Creates an attachment having the designated name and description.
|
protected |
SerialisableAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType)
Creates an attachment having the designated name, description and content
type (MIME).
|
protected |
SerialisableAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
boolean inline)
Creates an attachment having the designated name, description and content type (MIME).
|
protected |
SerialisableAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.lang.String inlineName)
Creates an attachment having the designated name, description and content type (MIME).
|
| Modifier and Type | Method and Description |
|---|---|
abstract java.io.InputStream |
getContent()
Gets the content of the attachment represented as
InputStream. |
java.lang.String |
getContentType()
Gets the content type (MIME) of the attachment.
|
java.lang.String |
getDescription()
Gets the description of the attachment.
|
java.lang.String |
getInlineName()
Gets the name used in the corresponding HTML message to refer to this attachment.
|
java.lang.String |
getName()
Gets the name of the attachment.
|
protected final java.lang.String name
protected final java.lang.String description
protected final java.lang.String contentType
protected final java.lang.String inlineName
null if the attachment should not be inlined.protected SerialisableAttachment(java.lang.String name,
java.lang.String description)
name - The name of the attachment.description - The description of the attachment.protected SerialisableAttachment(java.lang.String name,
java.lang.String description,
boolean inline)
name - The name of the attachment.description - The description of the attachment.inline - Whether to inline this attachment in case of an HTML message using the designated
name.protected SerialisableAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType)
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.protected SerialisableAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
boolean inline)
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.inline - Whether to inline this attachment in case of an HTML message using the designated
name.protected SerialisableAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.lang.String inlineName)
name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) 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 java.lang.String getName()
public java.lang.String getDescription()
public java.lang.String getContentType()
public java.lang.String getInlineName()
null if the attachment should not be inlined.null to not inline the attachment.public abstract java.io.InputStream getContent()
throws java.io.IOException
InputStream. InputStream cannot be serialised.java.io.IOException - If there are problems retrieving the content, for
instance converting the transferred serialisable data to an
InputStream, an IOException will be
thrown.