Movatterモバイル変換


[0]ホーム

URL:


         


Class MimePartDataSource

java.lang.Object  |  +--javax.mail.internet.MimePartDataSource
All Implemented Interfaces:
DataSource,MessageAware

public classMimePartDataSource
extends java.lang.Object
implementsDataSource,MessageAware

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

See Also:
MimePart,DataSource

MimePartDataSource(MimePart part)
          Constructor, that constructs a DataSource from a MimePart.
 
getContentType()
          Returns the content-type of this DataSource.
getInputStream()
          Returns an input stream from this MimePart.
getMessageContext()
          Return theMessageContext for the current part.
getName()
          DataSource method to return a name.
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
 

MimePartDataSource

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

getInputStream

public java.io.InputStreamgetInputStream()                                   throws java.io.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 thegetContentStream() method and decodes it using theMimeUtility.decode() method.

Specified by:
getInputStream in interfaceDataSource
Returns:
decoded input stream
See Also:
MimeMessage.getContentStream(),MimeBodyPart.getContentStream(),MimeUtility.decode(java.io.InputStream, java.lang.String)

getOutputStream

public java.io.OutputStreamgetOutputStream()                                     throws java.io.IOException
DataSource method to return an output stream.

This implementation throws the UnknownServiceException.

Specified by:
getOutputStream in interfaceDataSource
Following copied from interface:javax.activation.DataSource
Returns:
an OutputStream

getContentType

public java.lang.StringgetContentType()
Returns the content-type of this DataSource.

This implementation just invokes thegetContentType method on the MimePart.

Specified by:
getContentType in interfaceDataSource
Following copied from interface:javax.activation.DataSource
Returns:
the MIME Type

getName

public java.lang.StringgetName()
DataSource method to return a name.

This implementation just returns an empty string.

Specified by:
getName in interfaceDataSource
Following copied from interface:javax.activation.DataSource
Returns:
the name of the object.

getMessageContext

publicMessageContextgetMessageContext()
Return theMessageContext for the current part.
Specified by:
getMessageContext in interfaceMessageAware
Since:
JavaMail 1.1

         


[8]ページ先頭

©2009-2025 Movatter.jp