Top Description Methods
javax.mail

public Interface MultipartDataSource

extends DataSource
Imports
javax.activation.DataSource

MultipartDataSource is a DataSource that contains body parts. This allows "mail aware" DataContentHandlers to be implemented more efficiently by being aware of such DataSources and using the appropriate methods to access BodyParts.

Note that the data of a MultipartDataSource is also available as an input stream.

This interface will typically be implemented by providers that preparse multipart bodies, for example an IMAP provider.

Author
John Mani
See Also
javax.activation.DataSource

Method Summary

Modifier and TypeMethod and Description
public BodyPart

Returns:

the Part
getBodyPart
(int
the index of the desired Part
index
)

Get the specified Part.

public int

Returns:

number of parts
getCount
()

Return the number of enclosed BodyPart objects.

Inherited from javax.activation.DataSource:
getContentTypegetInputStreamgetNamegetOutputStream

Method Detail

getBodyPartback to summary
public BodyPart getBodyPart(int index) throws MessagingException

Get the specified Part. Parts are numbered starting at 0.

Parameters
index:int

the index of the desired Part

Returns:BodyPart

the Part

Exceptions
MessagingException:
for other failures
IndexOutOfBoundsException:
if the given index is out of range.
getCountback to summary
public int getCount()

Return the number of enclosed BodyPart objects.

Returns:int

number of parts