javax.mail.internet
Class MimeMultipart
public class MimeMultipart
A MIME multipart container.
The default multipart subtype is "mixed". However, an application can
construct a MIME multipart object of any subtype using the
MimeMultipart(String)
constructor.
Version:
- Chris Burdess
protected DataSource | ds - The data source supplying the multipart data.
|
protected boolean | parsed - Indicates whether the data from the input stream has been parsed yet.
|
MimeMultipart() - Constructor for an empty MIME multipart of type "multipart/mixed".
|
MimeMultipart(DataSource ds) - Constructor with a given data source.
|
MimeMultipart(String subtype) - Constructor for an empty MIME multipart of the given subtype.
|
addBodyPart , addBodyPart , getBodyPart , getContentType , getCount , getParent , removeBodyPart , removeBodyPart , setMultipartDataSource , setParent , writeTo |
ds
protected DataSource ds
The data source supplying the multipart data.
parsed
protected boolean parsed
Indicates whether the data from the input stream has been parsed yet.
MimeMultipart
public MimeMultipart()
Constructor for an empty MIME multipart of type "multipart/mixed".
MimeMultipart
public MimeMultipart(DataSource ds)
throws MessagingException
Constructor with a given data source.
ds
- the data source, which can be a MultipartDataSource
MimeMultipart
public MimeMultipart(String subtype)
Constructor for an empty MIME multipart of the given subtype.
createInternetHeaders
protected InternetHeaders createInternetHeaders(InputStream is)
throws MessagingException
Creates headers from the specified input stream.
is
- the input stream to read the headers from
createMimeBodyPart
protected MimeBodyPart createMimeBodyPart(InputStream is)
throws MessagingException
Creates a MIME body part from the specified input stream.
is
- the input stream to parse the part from
createMimeBodyPart
protected MimeBodyPart createMimeBodyPart(InternetHeaders headers,
byte[] content)
throws MessagingException
Creates a MIME body part object from the given headers and byte content.
headers
- the part headerscontent
- the part content
getBodyPart
public BodyPart getBodyPart(String CID)
throws MessagingException
Returns the body part identified by the given Content-ID (CID).
CID
- the Content-ID of the desired part
parse
protected void parse()
throws MessagingException
Parses the body parts from this multipart's data source.
setSubType
public void setSubType(String subtype)
throws MessagingException
Sets the subtype.
updateHeaders
protected void updateHeaders()
throws MessagingException
Updates the headers of this part to be consistent with its content.
writeTo
public void writeTo(OutputStream os)
throws IOException,
MessagingException
Writes this multipart to the specified output stream.
This method iterates through all the component parts, outputting each
part separated by the Content-Type boundary parameter.
- writeTo in interface Multipart
© Copyright 2003, 2004
The Free Software Foundation, All rights reserved