This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.mail.internet
class MimePartDataSource

javax.mail.internet.MimePartDataSource
All Implemented Interfaces:
DataSource, MessageAware
Direct Known Subclasses:
IMAPMultipartDataSource

public class MimePartDataSource
extends Object
implements DataSource, MessageAware

A utility class that implements a DataSource out of a MimePart. This class is primarily meant for service providers.

See Also (auto-generated):

Session

Realm

Factory


Field Summary
protected MimePart part
          The MimePart that provides the data for this DataSource.
 
Constructor Summary

          Constructor, that constructs a DataSource from a MimePart.
 
Method Summary
 String

          Returns the content-type of this DataSource.
 InputStream

          Returns an input stream from this MimePart.
 MessageContext

          Return the MessageContext for the current part.
 String

          DataSource method to return a name.
 OutputStream

          DataSource method to return an output stream.
 

Field Detail

part

protected MimePart part
The MimePart that provides the data for this DataSource.
Constructor Detail

MimePartDataSource

public MimePartDataSource(MimePart part)
Constructor, that constructs a DataSource from a MimePart.

Parameters:
part
Method Detail

getContentType

public String getContentType()
Returns the content-type of this DataSource.

This implementation just invokes the getContentType method on the MimePart.


getInputStream

public InputStream getInputStream()
                           throws IOException
Returns an input stream from this MimePart.

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.

Returns:
decoded input stream
Throws:
IOException

getMessageContext

public synchronized MessageContext getMessageContext()
Return the MessageContext for the current part.


getName

public String getName()
DataSource method to return a name.

This implementation just returns an empty string.


getOutputStream

public OutputStream getOutputStream()
                             throws IOException
DataSource method to return an output stream.

This implementation throws the UnknownServiceException.

Throws:
IOException


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention. The official Sun™ documentation can be found here at http://java.sun.com/products/javamail/javadocs/index.html.