javax.mail.internet

Class MimeMultipart


public class MimeMultipart
extends Multipart

Field Summary

protected DataSource
ds
DataSource that provides our InputStream.
protected boolean
parsed
Indicates if the data has been parsed.

Fields inherited from class javax.mail.Multipart

contentType, parent, parts

Constructor Summary

MimeMultipart()
Create an empty MimeMultipart with content type "multipart/mixed"
MimeMultipart(DataSource dataSource)
Create a MimeMultipart from the supplied DataSource.
MimeMultipart(String subtype)
Create an empty MimeMultipart with the subtype supplied.

Method Summary

protected InternetHeaders
createInternetHeaders(InputStream in)
protected MimeBodyPart
createMimeBodyPart(InputStream in)
protected MimeBodyPart
createMimeBodyPart(InternetHeaders headers, byte[] data)
BodyPart
getBodyPart(String cid)
BodyPart
getBodyPart(int part)
int
getCount()
protected void
parse()
void
setSubType(String subtype)
protected void
updateHeaders()
void
writeTo(OutputStream out)

Methods inherited from class javax.mail.Multipart

addBodyPart, addBodyPart, getBodyPart, getContentType, getCount, getParent, removeBodyPart, removeBodyPart, setMultipartDataSource, setParent, writeTo

Field Details

ds

protected DataSource ds
DataSource that provides our InputStream.

parsed

protected boolean parsed
Indicates if the data has been parsed.

Constructor Details

MimeMultipart

public MimeMultipart()
Create an empty MimeMultipart with content type "multipart/mixed"

MimeMultipart

public MimeMultipart(DataSource dataSource)
            throws MessagingException
Create a MimeMultipart from the supplied DataSource.
Parameters:
dataSource - the DataSource to use

MimeMultipart

public MimeMultipart(String subtype)
Create an empty MimeMultipart with the subtype supplied.
Parameters:
subtype - the subtype

Method Details

createInternetHeaders

protected InternetHeaders createInternetHeaders(InputStream in)
            throws MessagingException

createMimeBodyPart

protected MimeBodyPart createMimeBodyPart(InputStream in)
            throws MessagingException

createMimeBodyPart

protected MimeBodyPart createMimeBodyPart(InternetHeaders headers,
                                          byte[] data)
            throws MessagingException

getBodyPart

public BodyPart getBodyPart(String cid)
            throws MessagingException

getBodyPart

public BodyPart getBodyPart(int part)
            throws MessagingException
Overrides:
getBodyPart in interface Multipart

getCount

public int getCount()
            throws MessagingException
Overrides:
getCount in interface Multipart

parse

protected void parse()
            throws MessagingException

setSubType

public void setSubType(String subtype)
            throws MessagingException

updateHeaders

protected void updateHeaders()
            throws MessagingException

writeTo

public void writeTo(OutputStream out)
            throws IOException,
                   MessagingException
Overrides:
writeTo in interface Multipart