|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.mail.internet.MimePartDataSource
public class MimePartDataSource
A utility class that implements a DataSource out of a MimePart. This class is primarily meant for service providers.
MimePart
,
DataSource
Field Summary | |
---|---|
protected MimePart |
part
The MimePart that provides the data for this DataSource. |
Constructor Summary | |
---|---|
MimePartDataSource(MimePart part)
Constructor, that constructs a DataSource from a MimePart. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MimePart part
Constructor Detail |
---|
public MimePartDataSource(MimePart part)
Method Detail |
---|
public 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
in interface DataSource
IOException
MimeMessage.getContentStream()
,
MimeBodyPart.getContentStream()
,
MimeUtility.decode(java.io.InputStream, java.lang.String)
public OutputStream getOutputStream() throws IOException
This implementation throws the UnknownServiceException.
getOutputStream
in interface DataSource
IOException
public String getContentType()
This implementation just invokes the getContentType
method on the MimePart.
getContentType
in interface DataSource
public String getName()
This implementation just returns an empty string.
getName
in interface DataSource
public MessageContext getMessageContext()
MessageContext
for the current part.
getMessageContext
in interface MessageAware
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.