public interface Attachment
extends java.io.Serializable
Example:
Attachment attachment =
AttachmentFactory.getInstance().createAttachment("xyz",
"plain/text; charset=us-ascii",
"Attachment Content".getBytes("us-ascii"));
message.addAttachment(attachment);
Modifier and Type | Method and Description |
---|---|
byte[] |
getAsByteArray()
Gets the attachment contents as a byte array
|
java.lang.String |
getContentID()
Gets the content identifier associated with the attachment
|
java.lang.String |
getContentType()
Gets the attachment content type
|
java.io.InputStream |
getInputStream()
Gets the attachment contents as an input stream
|
java.lang.String |
getPartName()
Gets the MIME part name for the attachment
|
int |
getSize()
Gets the attachment contents size, measured in number of bytes
|
java.lang.String |
getTransferEncoding()
Gets the transfer encoding for the attachment
|
void |
setContentID(java.lang.String contentId)
Sets the content identifier associated with the attachment
|
void |
setContentType(java.lang.String contentType)
Sets the attachment content type
|
void |
setPartName(java.lang.String name)
Sets the MIME part name for the attachment
|
void |
setTransferEncoding(java.lang.String encoding)
Sets the transfer encoding for the attachment
|
byte[] getAsByteArray() throws java.io.IOException
java.io.IOException
java.lang.String getContentID()
java.lang.String getContentType()
java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
java.lang.String getPartName()
int getSize() throws java.io.IOException
java.io.IOException
java.lang.String getTransferEncoding()
void setContentID(java.lang.String contentId)
contentId
- the content identifiervoid setContentType(java.lang.String contentType)
contentType
- the content typevoid setPartName(java.lang.String name)
name
- the part namevoid setTransferEncoding(java.lang.String encoding)
encoding
- A valid transfer encoding, complying to those values defined by http://www.iana.org/assignments/transfer-encodings/