public class Attachment extends AttachHeader
AttachHeader
fields it adds methods to
work with the attachment itself: getInputStream()
, getText()
and getText(String)
.iAttachID, iFileSize, iMailID, sContentDisposition, sContentEncoding, sContentID, sContentType, sFileName, sName
mHeaders, sBoundary, sCompleteHeader
Constructor and Description |
---|
Attachment(java.lang.String sHeader)
Constructor that initializes only the header fields.
|
Attachment(java.lang.String sAttachmentHeader,
java.lang.String sBody)
Constructor that initializes both the headers and the body.
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
getDecodedInputStream()
Get the decoded input stream.
|
java.io.InputStream |
getInputStream()
Get the raw input stream, as seen when looking at the mail source
|
java.lang.String |
getText()
Convert the attachment to a String, using the encoding specified in the attachment header, if any,
otherwise use the default "us-ascii" encoding.
|
java.lang.String |
getText(java.lang.String sEncoding)
Convert the attachment to a String, using the supplied encoding.
|
toString
getOriginalHeader, getValue, main
public Attachment(java.lang.String sHeader)
sHeader
- attachment headerpublic Attachment(java.lang.String sAttachmentHeader, java.lang.String sBody)
sAttachmentHeader
- attachment headersBody
- attachment raw body, as it is seen in the emailpublic java.io.InputStream getInputStream()
public java.io.InputStream getDecodedInputStream()
public java.lang.String getText()
public java.lang.String getText(java.lang.String sEncoding)
sEncoding
- the encoding to be used