| |
|
| java.lang.Object org.jvnet.mimepull.MIMEPart
MIMEPart | public class MIMEPart (Code) | | Represents an attachment part in a MIME message. MIME message parsing is done
lazily using a pull parser, so the part may not have all the data.
MIMEPart.read and
MIMEPart.readOnce may trigger the actual parsing the message. In fact,
parsing of an attachment part may be triggered by calling
MIMEPart.read methods
on some other attachemnt parts. All this happens behind the scenes so the
application developer need not worry about these details.
author: Jitendra Kotamraju |
parsed | volatile boolean parsed(Code) | | |
addBody | void addBody(ByteBuffer buf)(Code) | | Callback to notify that there is a partial content for the part
Parameters: buf - content data for the part |
close | public void close()(Code) | | Cleans up any resources that are held by this part (for e.g. deletes
the temp file that is used to serve this part's content). After
calling this, one shouldn't call
MIMEPart.read() or
MIMEPart.readOnce() |
doneParsing | void doneParsing()(Code) | | Callback to indicate that parsing is done for this part
(no more update events for this part)
|
getAllHeaders | public List<? extends Header> getAllHeaders()(Code) | | Return all the headers
list of Header objects |
getContentId | public String getContentId()(Code) | | Returns Content-ID MIME header for this attachment part
Content-ID of the part |
getContentType | public String getContentType()(Code) | | Returns Content-Type MIME header for this attachment part
Content-Type of the part |
getHeader | public List<String> getHeader(String name)(Code) | | Return all the values for the specified header.
Returns null if no headers with the
specified name exist.
Parameters: name - header name list of header values, or null if none |
read | public InputStream read()(Code) | | Can get the attachment part's content multiple times. That means
the full content needs to be there in memory or on the file system.
Calling this method would trigger parsing for the part's data. So
do not call this unless it is required(otherwise, just wrap MIMEPart
into a object that returns InputStream for e.g DataHandler)
data for the part's content |
readOnce | public InputStream readOnce()(Code) | | Can get the attachment part's content only once. The content
will be lost after the method. Content data is not be stored
on the file system or is not kept in the memory for the
following case:
- Attachement parts contents are accessed sequentially
In general, take advantage of this when the data is used only
once.
data for the part's content |
setContentId | void setContentId(String cid)(Code) | | Callback to set Content-ID for this part
Parameters: cid - Content-ID of the part |
setHeaders | void setHeaders(InternetHeaders headers)(Code) | | Callback to set headers
Parameters: headers - MIME headers for the part |
|
|
|