public class MimePartDataSource extends Object implements DataSource, MessageAware
MimePart,
DataSource| 限定符和类型 | 字段和说明 |
|---|---|
protected MimePart |
part
The MimePart that provides the data for this DataSource.
|
| 构造器和说明 |
|---|
MimePartDataSource(MimePart part)
Constructor, that constructs a DataSource from a MimePart.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getContentType()
Returns the content-type of this DataSource.
|
InputStream |
getInputStream()
Returns an input stream from this MimePart.
|
MessageContext |
getMessageContext()
Return the
MessageContext for the current part. |
String |
getName()
DataSource method to return a name.
|
OutputStream |
getOutputStream()
DataSource method to return an output stream.
|
protected MimePart part
public MimePartDataSource(MimePart part)
part - the MimePartpublic InputStream getInputStream() throws IOException
This method applies the appropriate transfer-decoding, based on the Content-Transfer-Encoding attribute of this MimePart. Thus the returned input stream is a decoded stream of bytes.
This implementation obtains the raw content from the Part
using the getContentStream() method and decodes
it using the MimeUtility.decode() method.
getInputStream 在接口中 DataSourceIOExceptionMimeMessage.getContentStream(),
MimeBodyPart.getContentStream(),
MimeUtility.decode(java.io.InputStream, java.lang.String)public OutputStream getOutputStream() throws IOException
This implementation throws the UnknownServiceException.
getOutputStream 在接口中 DataSourceIOExceptionpublic String getContentType()
This implementation just invokes the getContentType
method on the MimePart.
getContentType 在接口中 DataSourcepublic String getName()
This implementation just returns an empty string.
getName 在接口中 DataSourcepublic MessageContext getMessageContext()
MessageContext for the current part.getMessageContext 在接口中 MessageAwareCopyright © 2021 Oracle. All rights reserved.