| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 |
Returns the content-type of this DataSource. |
InputStream |
Returns an input stream from this MimePart. |
MessageContext |
Return the MessageContext for the current part.
|
String |
getName() DataSource method to return a name. |
OutputStream |
DataSource method to return an output stream. |
Field Detail |
---|
protected MimePart part
Constructor Detail |
---|
public MimePartDataSource(MimePart part)
part
Method Detail |
---|
public String getContentType()
This implementation just invokes the getContentType
method on the MimePart.
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.
IOException
public synchronized MessageContext getMessageContext()
MessageContext
for the current part.
public String getName()
This implementation just returns an empty string.
public OutputStream getOutputStream() throws IOException
This implementation throws the UnknownServiceException.
IOException
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |