gnu.mail.providers.imap

Class IMAPMultipartDataSource

Implemented Interfaces:
DataSource, MultipartDataSource

public class IMAPMultipartDataSource
extends java.lang.Object
implements MultipartDataSource

An IMAP multipart component.

Field Summary

protected IMAPMultipart
multipart
The multipart object this data source is associated with.

Constructor Summary

IMAPMultipartDataSource(IMAPMultipart multipart)
Called by the IMAPMessage.

Method Summary

BodyPart
getBodyPart(int index)
Returns the secified sub-part of the multipart.
String
getContentType()
Returns the content type of the body part that contains the multipart.
int
getCount()
Returns the number of sub-parts of the multipart.
InputStream
getInputStream()
Returns an input stream from which the content of this multipart can be read.
String
getName()
Returns the content description of the body part that contains the multipart.
OutputStream
getOutputStream()
IMAP multiparts are read-only.

Field Details

multipart

protected IMAPMultipart multipart
The multipart object this data source is associated with.

Constructor Details

IMAPMultipartDataSource

protected IMAPMultipartDataSource(IMAPMultipart multipart)
Called by the IMAPMessage.

Method Details

getBodyPart

public BodyPart getBodyPart(int index)
            throws MessagingException
Returns the secified sub-part of the multipart.
Specified by:
getBodyPart in interface MultipartDataSource

getContentType

public String getContentType()
Returns the content type of the body part that contains the multipart.

getCount

public int getCount()
Returns the number of sub-parts of the multipart.
Specified by:
getCount in interface MultipartDataSource

getInputStream

public InputStream getInputStream()
            throws IOException
Returns an input stream from which the content of this multipart can be read.

getName

public String getName()
Returns the content description of the body part that contains the multipart.

getOutputStream

public OutputStream getOutputStream()
            throws IOException
IMAP multiparts are read-only.