站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Java Platform, Enterprise Edition v1.4 API Specifications

MultipartDataSource (Java 2 Platform Ent. Ed. v1.4) - Java Platform, Enterprise Edition v1.4 API Specifications

JavaTM 2 Platform
Ent. Ed. v1.4

javax.mail
Interface MultipartDataSource

All Superinterfaces:
DataSource

public interface MultipartDataSource
extends 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.

Version:
1.6, 02/03/27
Author:
John Mani
See Also:
DataSource

Method Summary
 BodyPart getBodyPart(int index)
          Get the specified Part.
 int getCount()
          Return the number of enclosed BodyPart objects.
 
Methods inherited from interface javax.activation.DataSource
getContentType, getInputStream, getName, getOutputStream
 

Method Detail

getCount

public int getCount()
Return the number of enclosed BodyPart objects.

Returns:
number of parts

getBodyPart

public BodyPart getBodyPart(int index)
                     throws MessagingException
Get the specified Part. Parts are numbered starting at 0.

Parameters:
index - the index of the desired Part
Returns:
the Part
Throws:
IndexOutOfBoundsException - if the given index is out of range.
MessagingException

JavaTM 2 Platform
Ent. Ed. v1.4

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.