java.lang.Object | +--javax.mail.internet.MimePartDataSource
A utility class that implements a DataSource out of a MimePart. This class is primarily meant for service providers.
MimePart
,
DataSource
MimePartDataSource(MimePart part)
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public MimePartDataSource(MimePart part)
public java.io.InputStream getInputStream() throws java.io.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
in interface DataSource
MimeMessage.getContentStream()
,
MimeBodyPart.getContentStream()
,
MimeUtility.decode(java.io.InputStream, java.lang.String)
public java.io.OutputStream getOutputStream() throws java.io.IOException
This implementation throws the UnknownServiceException.
getOutputStream
in interface DataSource
javax.activation.DataSource
public java.lang.String getContentType()
This implementation just invokes the getContentType
method on the MimePart.
getContentType
in interface DataSource
javax.activation.DataSource
public java.lang.String getName()
This implementation just returns an empty string.
getName
in interface DataSource
javax.activation.DataSource
public MessageContext getMessageContext()
MessageContext
for the current part.getMessageContext
in interface MessageAware