MultipartDataSource (Java EE 5)

Java EE API


javax.mail Interface MultipartDataSource

All Superinterfaces:
DataSource

public interface MultipartDataSource
extends DataSource

Implements: DataSource

MultipartDataSource 是包含正文部分的 DataSource。此接口可以感知此类 DataSources 并使用适当的方法访问 BodyParts,能更有效地实现“邮件感知的”DataContentHandlers

注意,MultipartDataSource 的数据也可以用作输入流。

此接口通常由预先解析 multipart 正文的提供者实现,例如 IMAP 提供者。

英文文档:

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.8, 07/05/04
Author:
John Mani
See Also:
DataSource

Method Summary
 BodyPart
 int
 
Methods inherited from interface javax.activation.DataSource
 

Method Detail

public int getCount()
返回封闭 BodyPart 对象的数量。
return 部分数
英文文档:

getCount

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

Returns:
number of parts

public BodyPart getBodyPart(int index) throws MessagingException
获取指定的 Part。Part 是从 0 开始编号的。
index 所需 Part 的索引
return Part
ThrowsIndexOutOfBoundsException: 如果给定索引超出范围。
ThrowsMessagingException:
英文文档:

getBodyPart

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


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!