public class Attachment extends Object
NamedResource
for
more information.NamedResource
for
more information.ContentDisposition.ATTACHMENT
by
default)Constructor and Description |
---|
Attachment(File file)
Initialize the attachment with the provided file.
|
Attachment(File file,
String description)
Initialize the attachment with the provided file and description of the
attachment.
|
Attachment(File file,
String description,
String disposition)
Initialize the attachment with the provided file, description of the
attachment and disposition (how to include the attachment into the mail).
|
Attachment(NamedResource resource)
Initialize the attachment with the provided resource (content and name).
|
Attachment(NamedResource resource,
String description)
Initialize the attachment with the provided resource (content and name),
the description of the attachment.
|
Attachment(NamedResource resource,
String description,
String disposition)
Initialize the attachment with the provided resource (content and name),
the description of the attachment and the disposition (how to include the
attachment into the mail).
|
Attachment(NamedResource resource,
String description,
String disposition,
String contentId)
Initialize the attachment with the provided resource (content and name),
the description of the attachment and the disposition (how to include the
attachment into the mail).
|
Attachment(String path)
Initialize the attachment with the provided path.
|
Attachment(String name,
byte[] content)
Initialize the attachment with the provided content and name.
|
Attachment(String name,
byte[] content,
String description)
Initialize the attachment with the provided content, name and description
of the attachment.
|
Attachment(String name,
byte[] content,
String description,
String disposition)
Initialize the attachment with the provided content, name, description of
the attachment and disposition (how to include the attachment into the
mail).
|
Attachment(String name,
InputStream stream)
Initialize the attachment with the provided content and name.
|
Attachment(String name,
InputStream stream,
String description)
Initialize the attachment with the provided content, name and description
of the attachment.
|
Attachment(String name,
InputStream stream,
String description,
String disposition)
Initialize the attachment with the provided content, name, description of
the attachment and disposition (how to include the attachment into the
mail).
|
Attachment(String path,
String description)
Initialize the attachment with the provided path and description of the
attachment.
|
Attachment(String path,
String description,
String disposition)
Initialize the attachment with the provided path, description of the
attachment and disposition (how to include the attachment into the mail).
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getContentId() |
String |
getDescription() |
String |
getDisposition() |
NamedResource |
getResource() |
int |
hashCode() |
void |
setContentId(String contentId) |
void |
setDescription(String description) |
void |
setDisposition(String disposition) |
void |
setResource(NamedResource resource) |
String |
toString() |
public Attachment(NamedResource resource, String description, String disposition, String contentId)
resource
- the resource of the attachment (with name)description
- the description of the attachment (may be null)disposition
- the disposition of the attachmentcontentId
- the unique id of the content (may not null)public Attachment(NamedResource resource, String description, String disposition)
resource
- the resource of the attachment (with name)description
- the description of the attachment (may be null)disposition
- the disposition of the attachmentpublic Attachment(NamedResource resource, String description)
Initialize the attachment with the provided resource (content and name), the description of the attachment.
The disposition is set to ContentDisposition.ATTACHMENT
resource
- the resource of the attachmentdescription
- the description of the attachment (may be null)public Attachment(NamedResource resource)
Initialize the attachment with the provided resource (content and name).
The description is not used (set to null)
The disposition is set to ContentDisposition.ATTACHMENT
resource
- the resource of the attachmentpublic Attachment(String path, String description, String disposition)
Initialize the attachment with the provided path, description of the attachment and disposition (how to include the attachment into the mail).
The path may contain a lookup. The lookup is case sensitive and must end with a ':'. It must not contain another ':' character.
For example, a path could be "classpath:/email/hello.pdf". The lookup is "classpath:".
path
- the path to the attachmentdescription
- the description of the attachment (may be null)disposition
- the disposition of the attachmentpublic Attachment(String path, String description)
Initialize the attachment with the provided path and description of the attachment.
The path may contain a lookup. The lookup is case sensitive and must end with a ':'. It must not contain another ':' character.
For example, a path could be "classpath:/email/hello.pdf". The lookup is "classpath:".
The disposition is set to ContentDisposition.ATTACHMENT
path
- the path to the attachmentdescription
- the description of the attachment (may be null)public Attachment(String path)
Initialize the attachment with the provided path.
The path may contain a lookup. The lookup is case sensitive and must end with a ':'. It must not contain another ':' character.
For example, a path could be "classpath:/email/hello.pdf". The lookup is "classpath:".
The description is not used (set to null)
The disposition is set to ContentDisposition.ATTACHMENT
path
- the path to the attachmentpublic Attachment(String name, InputStream stream, String description, String disposition) throws IOException
name
- the name of the attachmentstream
- the content of the attachment accessible trough the streamdescription
- the description of the attachment (may be null)disposition
- the disposition of the attachmentIOException
- when the content of the stream can't be readpublic Attachment(String name, InputStream stream, String description) throws IOException
Initialize the attachment with the provided content, name and description of the attachment.
The disposition is set to ContentDisposition.ATTACHMENT
name
- the name of the attachmentstream
- the content of the attachment accessible trough the streamdescription
- the description of the attachment (may be null)IOException
- when the content of the stream can't be readpublic Attachment(String name, InputStream stream) throws IOException
Initialize the attachment with the provided content and name.
The description is not used (set to null)
The disposition is set to ContentDisposition.ATTACHMENT
name
- the name of the attachmentstream
- the content of the attachment accessible trough the streamIOException
- when the content of the stream can't be readpublic Attachment(String name, byte[] content, String description, String disposition)
name
- the name of the attachmentcontent
- the content of the attachmentdescription
- the description of the attachment (may be null)disposition
- the disposition of the attachmentpublic Attachment(String name, byte[] content, String description)
Initialize the attachment with the provided content, name and description of the attachment.
The disposition is set to ContentDisposition.ATTACHMENT
name
- the name of the attachmentcontent
- the content of the attachmentdescription
- the description of the attachment (may be null)public Attachment(String name, byte[] content)
Initialize the attachment with the provided content and name.
The description is not used (set to null)
The disposition is set to ContentDisposition.ATTACHMENT
name
- the name of the attachmentcontent
- the content of the attachmentpublic Attachment(File file, String description, String disposition)
The name of the attachment is the name of the file.
file
- the file to attachdescription
- the description of the attachment (may be null)disposition
- the disposition of the attachmentpublic Attachment(File file, String description)
Initialize the attachment with the provided file and description of the attachment.
The name of the attachment is the name of the file.
The disposition is set to ContentDisposition.ATTACHMENT
file
- the file to attachdescription
- the description of the attachment (may be null)public Attachment(File file)
Initialize the attachment with the provided file.
The name of the attachment is the name of the file.
The description is not used (set to null)
The disposition is set to ContentDisposition.ATTACHMENT
file
- the file to attachpublic String getDescription()
public void setDescription(String description)
public String getDisposition()
public void setDisposition(String disposition)
public NamedResource getResource()
public void setResource(NamedResource resource)
public String getContentId()
public void setContentId(String contentId)
Copyright © 2017. All rights reserved.