IT. Expert System.

Java Enterprise Edition (EE)

MimePartDataSource


javax.mail.internet
Class MimePartDataSource

java.lang.Object
  javax.mail.internet.MimePartDataSource
All Implemented Interfaces:
DataSource, MessageAware
public class MimePartDataSource
extends java.lang.Object
implements DataSource, MessageAware

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

Author:
John Mani
See Also:
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
 java.lang.String getContentType()
          Returns the content-type of this DataSource.
 java.io.InputStream getInputStream()
          Returns an input stream from this MimePart.
 MessageContext getMessageContext()
          Return the MessageContext for the current part.
 java.lang.String getName()
          DataSource method to return a name.
 java.io.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

part

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

Since:
JavaMail 1.4
Constructor Detail

MimePartDataSource

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

Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   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 the getContentStream() method and decodes it using the MimeUtility.decode() method.

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

getOutputStream

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

This implementation throws the UnknownServiceException.

Specified by:
getOutputStream in interface DataSource
Returns:
an OutputStream
Throws:
java.io.IOException

getContentType

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

This implementation just invokes the getContentType method on the MimePart.

Specified by:
getContentType in interface DataSource
Returns:
the MIME Type

getName

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

This implementation just returns an empty string.

Specified by:
getName in interface DataSource
Returns:
the name of the object.

getMessageContext

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

Specified by:
getMessageContext in interface MessageAware
Since:
JavaMail 1.1


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1906 / 248362522. Delta: 0.02643 с