Top Description Inners Fields Constructors Methods
com.sun.mail.handlers

public Class text_plain

extends handler_base
Class Inheritance
Known Direct Subclasses
com.sun.mail.handlers.text_xml, com.sun.mail.handlers.text_html
Imports
java.io.*, javax.activation.*, javax.mail.internet.ContentType, .MimeUtility

DataContentHandler for text/plain.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
text_plain.NoCloseOutputStream

An OuputStream wrapper that doesn't close the underlying stream.

Field Summary

Modifier and TypeField and Description
private static ActivationDataFlavor[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
public Object
getContent(DataSource
The DataSource representing the data to be converted.
ds
)

Implements javax.activation.DataContentHandler.getContent.

Return an object representing the data in its most preferred form.
protected ActivationDataFlavor[]
getDataFlavors()

Implements abstract com.sun.mail.handlers.handler_base.getDataFlavors.

Return an array of ActivationDataFlavors that we support.
public void
writeTo(Object
The object to be converted.
obj
,
String
The requested MIME type of the resulting byte stream.
type
,
OutputStream
The output stream into which to write the converted byte stream.
os
)

Implements javax.activation.DataContentHandler.writeTo.

Write the object to the output stream, using the specified MIME type.
Inherited from com.sun.mail.handlers.handler_base:
getDatagetTransferDatagetTransferDataFlavors

Field Detail

myDFback to summary
private static ActivationDataFlavor[] myDF

Constructor Detail

text_plainback to summary
public text_plain()

Method Detail

getCharsetback to summary
private String getCharset(String type)
getContentback to summary
public Object getContent(DataSource ds) throws IOException

Implements javax.activation.DataContentHandler.getContent.

Doc from javax.activation.DataContentHandler.getContent.

Return an object representing the data in its most preferred form. Generally this will be the form described by the first DataFlavor returned by the getTransferDataFlavors method.

Parameters
ds:DataSource

The DataSource representing the data to be converted.

Returns:Object

The constructed Object.

Annotations
@Override
Exceptions
IOException:
if the data can't be accessed
getDataFlavorsback to summary
protected ActivationDataFlavor[] getDataFlavors()

Implements abstract com.sun.mail.handlers.handler_base.getDataFlavors.

Doc from com.sun.mail.handlers.handler_base.getDataFlavors.

Return an array of ActivationDataFlavors that we support. Usually there will be only one.

Returns:ActivationDataFlavor[]

array of ActivationDataFlavors that we support

Annotations
@Override
writeToback to summary
public void writeTo(Object obj, String type, OutputStream os) throws IOException

Implements javax.activation.DataContentHandler.writeTo.

Write the object to the output stream, using the specified MIME type.

Parameters
obj:Object

Doc from javax.activation.DataContentHandler.writeTo.

The object to be converted.

type:String

Doc from javax.activation.DataContentHandler.writeTo.

The requested MIME type of the resulting byte stream.

os:OutputStream

Doc from javax.activation.DataContentHandler.writeTo.

The output stream into which to write the converted byte stream.

Annotations
@Override
Exceptions
IOException:

Doc from javax.activation.DataContentHandler.writeTo.

errors writing to the stream

com.sun.mail.handlers back to summary

private Class text_plain.NoCloseOutputStream

extends FilterOutputStream
Class Inheritance

An OuputStream wrapper that doesn't close the underlying stream.

Field Summary

Inherited from java.io.FilterOutputStream:
out

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with the stream.
Inherited from java.io.FilterOutputStream:
flushwritewritewrite

Constructor Detail

NoCloseOutputStreamback to summary
public NoCloseOutputStream(OutputStream os)

Method Detail

closeback to summary
public void close()

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.FilterOutputStream.close.

Closes this output stream and releases any system resources associated with the stream.

Annotations
@Override