public class Attachment extends AbstractPart
Constructor and Description |
---|
Attachment() |
Modifier and Type | Method and Description |
---|---|
static Attachment |
attachmentWithContentsOfFile(java.lang.String filename)
Returns an attachment with the content of the given file.
|
static Attachment |
attachmentWithData(java.lang.String filename,
byte[] data)
Returns an attachment with the given data and the given filename.
|
static Attachment |
attachmentWithHTMLString(java.lang.String htmlString)
Returns an HTML text part with the given HTML.
|
static Attachment |
attachmentWithRFC822Message(byte[] messageData)
Returns RFC 822 message part with the given message data.
|
static Attachment |
attachmentWithText(java.lang.String text)
Returns a text part with the given text.
|
byte[] |
data()
Returns the data.
|
java.lang.String |
decodedString()
Returns the content of the attachment decoded using the charset encoding.
|
static java.lang.String |
mimeTypeForFilename(java.lang.String filename)
Returns the MIME type for the given filename.
|
void |
setData(byte[] data)
Sets the data.
|
allContentTypeParametersNames, charset, contentDescription, contentID, contentLocation, contentTypeParameterValueForName, filename, isInlineAttachment, partForContentID, partForUniqueID, partType, setCharset, setContentDescription, setContentID, setContentLocation, setContentTypeParameter, setFilename, setInlineAttachment, setPartType, setUniqueID, uniqueID
clone, finalize, initWithNative, readObject, toString, writeObject
public static java.lang.String mimeTypeForFilename(java.lang.String filename)
public static Attachment attachmentWithContentsOfFile(java.lang.String filename)
public static Attachment attachmentWithData(java.lang.String filename, byte[] data)
public static Attachment attachmentWithHTMLString(java.lang.String htmlString)
public static Attachment attachmentWithRFC822Message(byte[] messageData)
public static Attachment attachmentWithText(java.lang.String text)
public byte[] data()
public void setData(byte[] data)
public java.lang.String decodedString()
AbstractPart.charset()