Package gnu.mail.providers.imap
Class IMAPMultipartDataSource
- java.lang.Object
-
- gnu.mail.providers.imap.IMAPMultipartDataSource
-
- All Implemented Interfaces:
javax.activation.DataSource
,MultipartDataSource
public class IMAPMultipartDataSource extends java.lang.Object implements MultipartDataSource
An IMAP multipart component.- Version:
- 0.1
- Author:
- Chris Burdess
-
-
Field Summary
Fields Modifier and Type Field Description protected IMAPMultipart
multipart
The multipart object this data source is associated with.
-
Constructor Summary
Constructors Modifier Constructor Description protected
IMAPMultipartDataSource(IMAPMultipart multipart)
Called by the IMAPMessage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BodyPart
getBodyPart(int index)
Returns the secified sub-part of the multipart.java.lang.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.java.io.InputStream
getInputStream()
Returns an input stream from which the content of this multipart can be read.java.lang.String
getName()
Returns the content description of the body part that contains the multipart.java.io.OutputStream
getOutputStream()
IMAP multiparts are read-only.
-
-
-
Field Detail
-
multipart
protected IMAPMultipart multipart
The multipart object this data source is associated with.
-
-
Constructor Detail
-
IMAPMultipartDataSource
protected IMAPMultipartDataSource(IMAPMultipart multipart)
Called by the IMAPMessage.
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the content description of the body part that contains the multipart.- Specified by:
getName
in interfacejavax.activation.DataSource
-
getContentType
public java.lang.String getContentType()
Returns the content type of the body part that contains the multipart.- Specified by:
getContentType
in interfacejavax.activation.DataSource
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Returns an input stream from which the content of this multipart can be read.- Specified by:
getInputStream
in interfacejavax.activation.DataSource
- Throws:
java.io.IOException
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException
IMAP multiparts are read-only.- Specified by:
getOutputStream
in interfacejavax.activation.DataSource
- Throws:
java.io.IOException
-
getBodyPart
public BodyPart getBodyPart(int index) throws MessagingException
Returns the secified sub-part of the multipart.- Specified by:
getBodyPart
in interfaceMultipartDataSource
- Parameters:
index
- the index of the desired body part- Throws:
MessagingException
-
getCount
public int getCount()
Returns the number of sub-parts of the multipart.- Specified by:
getCount
in interfaceMultipartDataSource
-
-