public class URLAttachment extends SerialisableAttachment
SerialisableAttachment providing a URL for the
content. Note that this can only be used if the URL is
accessible by the mail service. Otherwise the content cannot be attached!| Modifier and Type | Field and Description |
|---|---|
protected java.net.URL |
url
The
URL where to get the content to attach from. |
contentType, description, inlineName, name| Constructor and Description |
|---|
URLAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.net.URL url)
Creates an attachment having the designated name, description, content
type (MIME) and
URL providing the content. |
URLAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.net.URL url,
boolean inline)
Creates an attachment having the designated name, description, content type (MIME) and
URL providing the content. |
URLAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.net.URL url,
java.lang.String inlineName)
Creates an attachment having the designated name, description, content type (MIME) and
URL providing the content. |
URLAttachment(java.lang.String name,
java.lang.String description,
java.net.URL url)
Creates an attachment having the designated name, description and
URL providing the content. |
URLAttachment(java.lang.String name,
java.lang.String description,
java.net.URL url,
boolean inline)
Creates an attachment having the designated name, description and
URL providing
the content. |
URLAttachment(java.lang.String name,
java.lang.String description,
java.net.URL url,
java.lang.String inlineName)
Creates an attachment having the designated name, description and
URL providing
the content. |
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getContent()
Gets the content of the attachment represented as
InputStream. |
getContentType, getDescription, getInlineName, getNamepublic URLAttachment(java.lang.String name,
java.lang.String description,
java.net.URL url)
URL providing the content. The content type is set to
"application/octet-stream".name - The name of the attachment.description - The description of the attachment.url - The URL where to get the content to attach from.
This needs to be accessible from the
MailService!public URLAttachment(java.lang.String name,
java.lang.String description,
java.net.URL url,
boolean inline)
URL providing
the content. The content type is set to "application/octet-stream".name - The name of the attachment.description - The description of the attachment.url - The URL where to get the content to attach from. This needs to be
accessible from the MailService!inline - Whether to inline this attachment in case of an HTML message using the designated
name.public URLAttachment(java.lang.String name,
java.lang.String description,
java.net.URL url,
java.lang.String inlineName)
URL providing
the content. The content type is set to "application/octet-stream".name - The name of the attachment.description - The description of the attachment.url - The URL where to get the content to attach from. This needs to be
accessible from the MailService!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 URLAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.net.URL url)
URL providing the content.name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.url - The URL where to get the content to attach from.
This needs to be accessible from the
MailService!public URLAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.net.URL url,
boolean inline)
URL providing the content.name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.url - The URL where to get the content to attach from. This needs to be
accessible from the MailService!inline - Whether to inline this attachment in case of an HTML message using the designated
name.public URLAttachment(java.lang.String name,
java.lang.String description,
java.lang.String contentType,
java.net.URL url,
java.lang.String inlineName)
URL providing the content.name - The name of the attachment.description - The description of the attachment.contentType - The content type (MIME) of the attachment.url - The URL where to get the content to attach from. This needs to be
accessible from the MailService!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.