Package org.apache.cxf.attachment
Class ImageDataContentHandler
java.lang.Object
org.apache.cxf.attachment.ImageDataContentHandler
- All Implemented Interfaces:
DataContentHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContent(DataSource ds) Return an object representing the data in its most preferred form.Returns an object which represents the data to be transferred.Returns an array of ActivationDataFlavor objects indicating the flavors the data can be provided in.voidwriteTo(Object obj, String mimeType, OutputStream os) Convert the object to a byte stream of the specified MIME type and write it to the output stream.
-
Constructor Details
-
ImageDataContentHandler
public ImageDataContentHandler()
-
-
Method Details
-
getContent
Description copied from interface:DataContentHandlerReturn an object representing the data in its most preferred form. Generally this will be the form described by the first ActivationDataFlavor returned by thegetTransferDataFlavorsmethod.- Specified by:
getContentin interfaceDataContentHandler- Parameters:
ds- The DataSource representing the data to be converted.- Returns:
- The constructed Object.
- Throws:
IOException- if the data can't be accessed
-
getTransferData
Description copied from interface:DataContentHandlerReturns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.- Specified by:
getTransferDatain interfaceDataContentHandler- Parameters:
df- The ActivationDataFlavor representing the requested type.ds- The DataSource representing the data to be converted.- Returns:
- The constructed Object.
- Throws:
IOException- if the handler doesn't support the requested flavor
-
getTransferDataFlavors
Description copied from interface:DataContentHandlerReturns an array of ActivationDataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).- Specified by:
getTransferDataFlavorsin interfaceDataContentHandler- Returns:
- The ActivationDataFlavors.
-
writeTo
Description copied from interface:DataContentHandlerConvert the object to a byte stream of the specified MIME type and write it to the output stream.- Specified by:
writeToin interfaceDataContentHandler- Parameters:
obj- The object to be converted.mimeType- The requested MIME type of the resulting byte stream.os- The output stream into which to write the converted byte stream.- Throws:
IOException- errors writing to the stream
-