|
Secure iNet Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jscape.inet.mime.MimeMessage
com.jscape.inet.mime.Attachment
Implements methods for creating an attachment to be added to a multi-part
MimeMessage.
Example Usage:
Attachment att = new Attachment(new File("c:/tmp/image.gif"));
| Field Summary |
| Fields inherited from interface com.jscape.inet.mime.MimeConstants |
COLON, CR, CRLF, EQUALS, LF, QUESTION_MARK, SEMI_COLON, SPACE, TAB |
| Constructor Summary | |
Attachment(byte[] data)
Constructs a new Attachment instance. |
|
Attachment(java.io.File file)
Constructs a new Attachment instance. |
|
Attachment(java.io.File file,
java.lang.String characterEncoding)
Constructs a new Attachment instance. |
|
Attachment(MimeMessage message)
Constructs a new Attachment instance from an existing MIME message. |
|
Attachment(java.lang.String filename,
byte[] data)
Constructs a new Attachment instance. |
|
Attachment(java.lang.String filename,
byte[] data,
java.lang.String characterEncoding)
Constructs a new Attachment instance. |
|
| Method Summary | |
java.lang.String |
getContentEncoding()
Gets Content-transfer-encoding header value for this Attachment. |
java.lang.String |
getContentType()
Gets content-type for this Attachment. |
byte[] |
getFileData()
Gets decoded content of this Attachment. |
java.lang.String |
getFilename()
Gets filename field contained in Content-Disposition header attribute for this Attachment. |
void |
setContentEncoding(java.lang.String ce)
Sets Content-Transfer-Encoding header for this Attachment. |
void |
setContentType(java.lang.String contentType)
Sets Content-Type header for this Attachment. |
| Methods inherited from class com.jscape.inet.mime.MimeMessage |
addHeader, addHeader, addPart, addReplaceHeader, addReplaceHeader, getBody, getBodyData, getBoundary, getContentTransferEncoding, getHeader, getHeaders, getHeaders, getHeaderValue, getMessage, getPart, getParts, getRawBodyData, removeHeader, removePart, removeParts, setBody, setBody, setBody, setBody |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Attachment(java.io.File file,
java.lang.String characterEncoding)
throws java.io.IOException,
MimeException
Attachment instance.
file - the file to be attachedcharacterEncoding - the character encoding of the attachment
filename
java.io.IOException - if an I/O error occurs
MimeException - if a MIME related parsing error occurs
public Attachment(java.io.File file)
throws java.io.IOException,
MimeException
Attachment instance.
file - the file to be attached
java.io.IOException - if an I/O error occurs
MimeException - if a MIME related parsing error occurs
public Attachment(java.lang.String filename,
byte[] data,
java.lang.String characterEncoding)
throws MimeException
Attachment instance.
filename - the filename of the attachmentdata - the byte[] data for attachmentcharacterEncoding - the character encoding used in the filename
MimeException - if a MIME related parsing error occurs
public Attachment(java.lang.String filename,
byte[] data)
throws MimeException
Attachment instance.
filename - the filename of the attachmentdata - the byte[] data for attachment
MimeException - if a MIME related parsing error occurs
public Attachment(byte[] data)
throws MimeException
Attachment instance.
data - the body byte[] data for attachment
MimeException - if a MIME related error occurs
public Attachment(MimeMessage message)
throws MimeException
Attachment instance from an existing MIME message.
message - the MimeMessage
MimeException - if a MIME related error occurs| Method Detail |
public java.lang.String getContentType()
Attachment.
getContentType in class MimeMessage
public void setContentType(java.lang.String contentType)
throws MimeException
Attachment.
setContentType in class MimeMessagecontentType - the content-type for this Attachment
MimeException - if a MIME related error occurspublic java.lang.String getContentEncoding()
Attachment.
null if not found
public void setContentEncoding(java.lang.String ce)
throws MimeException
Attachment.
ce - the content-transfer-encoding
MimeException - if a MIME related error occurspublic java.lang.String getFilename()
Attachment.
public byte[] getFileData()
throws java.lang.Exception
Attachment.
Attachment
java.lang.Exception - if message could not be decoded
|
Secure iNet Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||