Top Fields Constructors Methods
javax.activation

pack-priv Class DataSourceDataContentHandler

Located in compilation unit of javax.activation.DataHandler.

extends Object
implements DataContentHandler
Class Inheritance
All Implemented Interfaces
javax.activation.DataContentHandler

Field Summary

Modifier and TypeField and Description
private DataContentHandler
private DataSource
private DataFlavor[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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.
public Object

Returns:

the constructed Object
getTransferData
(DataFlavor
the DataFlavor
df
,
DataSource
the DataSource
ds
)

Implements javax.activation.DataContentHandler.getTransferData.

Return the Transfer Data of type DataFlavor from InputStream.
public DataFlavor[]

Returns:

the DataFlavors
getTransferDataFlavors
()

Implements javax.activation.DataContentHandler.getTransferDataFlavors.

Return the DataFlavors for this DataContentHandler.
public void
writeTo(Object
The object to be converted.
obj
,
String
The requested MIME type of the resulting byte stream.
mimeType
,
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.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dchback to summary
private DataContentHandler dch
dsback to summary
private DataSource ds
transferFlavorsback to summary
private DataFlavor[] transferFlavors

Constructor Detail

DataSourceDataContentHandlerback to summary
public DataSourceDataContentHandler(DataContentHandler dch, DataSource ds)

The constructor.

Method Detail

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.

Exceptions
IOException:
if the data can't be accessed
getTransferDataback to summary
public Object getTransferData(DataFlavor df, DataSource ds) throws UnsupportedFlavorException, IOException

Implements javax.activation.DataContentHandler.getTransferData.

Return the Transfer Data of type DataFlavor from InputStream.

Parameters
df:DataFlavor

the DataFlavor

ds:DataSource

the DataSource

Returns:Object

the constructed Object

Exceptions
UnsupportedFlavorException:

Doc from javax.activation.DataContentHandler.getTransferData.

if the handler doesn't support the requested flavor

IOException:

Doc from javax.activation.DataContentHandler.getTransferData.

if the data can't be accessed

getTransferDataFlavorsback to summary
public DataFlavor[] getTransferDataFlavors()

Implements javax.activation.DataContentHandler.getTransferDataFlavors.

Return the DataFlavors for this DataContentHandler.

Returns:DataFlavor[]

the DataFlavors

writeToback to summary
public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException

Implements javax.activation.DataContentHandler.writeTo.

Write the object to the output stream.

Parameters
obj:Object

Doc from javax.activation.DataContentHandler.writeTo.

The object to be converted.

mimeType: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.

Exceptions
IOException:

Doc from javax.activation.DataContentHandler.writeTo.

errors writing to the stream