| Modifier and Type | Field and Description |
|---|---|
| private BODYSTRUCTURE | |
| private static final boolean | |
| private String | |
| private boolean | |
| private IMAPMessage | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addHeader(String
header name name, String header value value)Overrides javax. Implements javax. |
| public void | addHeaderLine(String
the line to add line)Overrides javax. Implements javax. |
| public Enumeration | getAllHeaderLines()
Overrides javax. Implements javax. |
| public Enumeration | getAllHeaders()
Overrides javax. Implements javax. |
| public String | getContentID()
Overrides javax. Implements javax. |
| public String | getContentMD5()
Overrides javax. Implements javax. |
| protected InputStream | getContentStream()
Overrides javax. |
| public String | getContentType()
Overrides javax. Implements javax. |
| public synchronized DataHandler | getDataHandler()
Overrides javax. Implements javax. |
| public String | getDescription()
Overrides javax. Implements javax. |
| public String | getDisposition()
Overrides javax. Implements javax. |
| public String | getEncoding()
Overrides javax. Implements javax. |
| public String | getFileName()
Overrides javax. Implements javax. |
| public String[] | getHeader(String
name of header name)Overrides javax. Implements javax. |
| private InputStream | |
| public int | getLineCount()
Overrides javax. Implements javax. |
| public Enumeration | getMatchingHeaderLines(String[]
the headers to return names)Overrides javax. Implements javax. |
| public Enumeration | getMatchingHeaders(String[]
the headers to match names)Overrides javax. Implements javax. |
| public InputStream | Returns: the MIME format streamImplements com. |
| public Enumeration | getNonMatchingHeaderLines(String[]
the headers to not return names)Overrides javax. Implements javax. |
| public Enumeration | getNonMatchingHeaders(String[]
the headers to not match names)Overrides javax. Implements javax. |
| public int | getSize()
Overrides javax. Implements javax. |
| private synchronized void | |
| public void | removeHeader(String
the name of this header name)Overrides javax. Implements javax. |
| public void | setContent(Object
the content object o, String Mime type of the object type)Overrides javax. Implements javax. |
| public void | setContent(Multipart
The multipart object that is the Message's content mp)Overrides javax. Implements javax. |
| public void | setContentMD5(String
the MD5 value md5)Overrides javax. Implements javax. |
| public void | setDataHandler(DataHandler
The DataHandler for the content content)Overrides javax. Implements javax. |
| public void | setDescription(String
Description description, String Charset for encoding charset)
Set the "Content-Description" header field for this body part.
|
| public void | setDisposition(String
disposition of this part disposition)Overrides javax. Implements javax. |
| public void | setFileName(String
the file name filename)Overrides javax. Implements javax. |
| public void | setHeader(String
header name name, String header value value)Overrides javax. Implements javax. |
| protected void | updateHeaders()
Examine the content of this body part and update the appropriate
MIME headers.
|
| bs | back to summary |
|---|---|
| private BODYSTRUCTURE bs | |
| decodeFileName | back to summary |
|---|---|
| private static final boolean decodeFileName | |
| description | back to summary |
|---|---|
| private String description | |
| headersLoaded | back to summary |
|---|---|
| private boolean headersLoaded | |
| message | back to summary |
|---|---|
| private IMAPMessage message | |
| sectionId | back to summary |
|---|---|
| private String sectionId | |
| type | back to summary |
|---|---|
| private String type | |
| IMAPBodyPart | back to summary |
|---|---|
| protected IMAPBodyPart(BODYSTRUCTURE bs, String sid, IMAPMessage message) | |
| addHeader | back to summary |
|---|---|
| public void addHeader(String name, String value) throws MessagingException Overrides javax. Implements javax. Doc from javax. Add this value to the existing values for this header_name. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must be encoded as per the rules of RFC 2047.
| |
| addHeaderLine | back to summary |
|---|---|
| public void addHeaderLine(String line) throws MessagingException Overrides javax. Implements javax. Doc from javax. Add a header line to this body part
| |
| getAllHeaderLines | back to summary |
|---|---|
| public Enumeration Overrides javax. Implements javax. Doc from javax. Get all header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header line, containing both the "name" and "value" field.
| |
| getAllHeaders | back to summary |
|---|---|
| public Enumeration Overrides javax. Implements javax. Doc from javax. Return all the headers from this Message as an Enumeration of Header objects.
| |
| getContentID | back to summary |
|---|---|
| public String getContentID() throws MessagingException Overrides javax. Implements javax. Doc from javax. Returns the value of the "Content-ID" header field. Returns
This implementation uses
| |
| getContentMD5 | back to summary |
|---|---|
| public String getContentMD5() throws MessagingException Overrides javax. Implements javax. Doc from javax. Return the value of the "Content-MD5" header field. Returns
This implementation uses
| |
| getContentStream | back to summary |
|---|---|
| protected InputStream getContentStream() throws MessagingException Overrides javax. Doc from javax. Produce the raw bytes of the content. This method is used when creating a DataHandler object for the content. Subclasses that can provide a separate input stream for just the Part content might want to override this method.
| |
| getContentType | back to summary |
|---|---|
| public String getContentType() throws MessagingException Overrides javax. Implements javax. Doc from javax. Returns the value of the RFC 822 "Content-Type" header field. This represents the content type of the content of this body part. This value must not be null. If this field is unavailable, "text/plain" should be returned.
This implementation uses
| |
| getDataHandler | back to summary |
|---|---|
| public synchronized DataHandler getDataHandler() throws MessagingException Overrides javax. Implements javax. Doc from javax. Return a DataHandler for this body part's content. The implementation provided here works just like the the implementation in MimeMessage.
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() throws MessagingException Overrides javax. Implements javax. Doc from javax. Returns the "Content-Description" header field of this body part. This typically associates some descriptive information with this part. Returns null if this field is unavailable or its value is absent. If the Content-Description field is encoded as per RFC 2047, it is decoded and converted into Unicode. If the decoding or conversion fails, the raw data is returned as is.
This implementation uses
| |
| getDisposition | back to summary |
|---|---|
| public String getDisposition() throws MessagingException Overrides javax. Implements javax. Doc from javax. Returns the disposition from the "Content-Disposition" header field. This represents the disposition of this part. The disposition describes how the part should be presented to the user. If the Content-Disposition field is unavailable, null is returned.
This implementation uses
| |
| getEncoding | back to summary |
|---|---|
| public String getEncoding() throws MessagingException Overrides javax. Implements javax. Doc from javax. Returns the content transfer encoding from the
"Content-Transfer-Encoding" header
field. Returns
This implementation uses
| |
| getFileName | back to summary |
|---|---|
| public String getFileName() throws MessagingException Overrides javax. Implements javax. Doc from javax. Get the filename associated with this body part.
Returns the value of the "filename" parameter from the
"Content-Disposition" header field of this body part. If its
not available, returns the value of the "name" parameter from
the "Content-Type" header field of this body part.
Returns
If the
| |
| getHeader | back to summary |
|---|---|
| public String[] getHeader(String name) throws MessagingException Overrides javax. Implements javax. Doc from javax. Get all the headers for this header_name. Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.
| |
| getHeaderStream | back to summary |
|---|---|
| private InputStream getHeaderStream() throws MessagingException Return the MIME format stream of headers for this body part. | |
| getLineCount | back to summary |
|---|---|
| public int getLineCount() throws MessagingException Overrides javax. Implements javax. Doc from javax. Return the number of lines for the content of this Part. Return -1 if this number cannot be determined. Note that this number may not be an exact measure of the content length and may or may not account for any transfer encoding of the content. This implementation returns -1.
| |
| getMatchingHeaderLines | back to summary |
|---|---|
| public Enumeration Overrides javax. Implements javax. Doc from javax. Get matching header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header line, containing both the "name" and "value" field.
| |
| getMatchingHeaders | back to summary |
|---|---|
| public Enumeration Overrides javax. Implements javax. Doc from javax. Return matching headers from this Message as an Enumeration of Header objects.
| |
| getMimeStream | back to summary |
|---|---|
| public InputStream getMimeStream() throws MessagingException Implements com. Return the MIME format stream corresponding to this message part.
| |
| getNonMatchingHeaderLines | back to summary |
|---|---|
| public Enumeration Overrides javax. Implements javax. Doc from javax. Get non-matching header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header line, containing both the "name" and "value" field.
| |
| getNonMatchingHeaders | back to summary |
|---|---|
| public Enumeration Overrides javax. Implements javax. Doc from javax. Return non-matching headers from this Message as an Enumeration of Header objects.
| |
| getSize | back to summary |
|---|---|
| public int getSize() throws MessagingException Overrides javax. Implements javax. Doc from javax. Return the size of the content of this body part in bytes. Return -1 if the size cannot be determined. Note that this number may not be an exact measure of the content size and may or may not account for any transfer encoding of the content.
This implementation returns the size of the
| |
| loadHeaders | back to summary |
|---|---|
| private synchronized void loadHeaders() throws MessagingException | |
| removeHeader | back to summary |
|---|---|
| public void removeHeader(String name) throws MessagingException Overrides javax. Implements javax. Doc from javax. Remove all headers with this name.
| |
| setContent | back to summary |
|---|---|
| public void setContent(Object o, String type) throws MessagingException Overrides javax. Implements javax. Doc from javax. A convenience method for setting this body part's content.
The content is wrapped in a DataHandler object. Note that a
DataContentHandler class for the specified type should be
available to the JavaMail implementation for this to work right.
That is, to do
| |
| setContent | back to summary |
|---|---|
| public void setContent(Multipart mp) throws MessagingException Overrides javax. Implements javax. Doc from javax. This method sets the body part's content to a Multipart object.
| |
| setContentMD5 | back to summary |
|---|---|
| public void setContentMD5(String md5) throws MessagingException Overrides javax. Implements javax. Doc from javax. Set the "Content-MD5" header field of this body part.
| |
| setDataHandler | back to summary |
|---|---|
| public void setDataHandler(DataHandler content) throws MessagingException Overrides javax. Implements javax. Doc from javax. This method provides the mechanism to set this body part's content. The given DataHandler object should wrap the actual content.
| |
| setDescription | back to summary |
|---|---|
| public void setDescription(String description, String charset) throws MessagingException Overrides javax. Doc from javax. Set the "Content-Description" header field for this body part.
If the description parameter is If the description contains non US-ASCII characters, it will be encoded using the specified charset. If the description contains only US-ASCII characters, no encoding is done and it is used as is. Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.
| |
| setDisposition | back to summary |
|---|---|
| public void setDisposition(String disposition) throws MessagingException Overrides javax. Implements javax. Doc from javax. Set the disposition in the "Content-Disposition" header field of this body part. If the disposition is null, any existing "Content-Disposition" header field is removed.
| |
| setFileName | back to summary |
|---|---|
| public void setFileName(String filename) throws MessagingException Overrides javax. Implements javax. Doc from javax. Set the filename associated with this body part, if possible. Sets the "filename" parameter of the "Content-Disposition" header field of this body part. For compatibility with older mailers, the "name" parameter of the "Content-Type" header is also set.
If the
| |
| setHeader | back to summary |
|---|---|
| public void setHeader(String name, String value) throws MessagingException Overrides javax. Implements javax. Doc from javax. Set the value for this header_name. Replaces all existing header values with this new value. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must be encoded as per the rules of RFC 2047.
| |
| updateHeaders | back to summary |
|---|---|
| protected void updateHeaders() Overrides javax. Doc from javax. Examine the content of this body part and update the appropriate
MIME headers. Typical headers that get set here are
If the
| |