Package org.apache.axiom.mime
Class PartDataHandler
- java.lang.Object
-
- javax.activation.DataHandler
-
- org.apache.axiom.mime.PartDataHandler
-
- All Implemented Interfaces:
Transferable
public class PartDataHandler extends DataHandler
DataHandlerimplementation for MIME parts read from a stream.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPartDataHandler(Part part)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DataSourcecreateDataSource(Part part, String contentType)Create theDataSourceto be returned bygetDataSource().DataSourcegetDataSource()PartgetPart()Get the MIME part linked to this data handler.voidwriteTo(OutputStream os)-
Methods inherited from class javax.activation.DataHandler
getAllCommands, getBean, getCommand, getContent, getContentType, getInputStream, getName, getOutputStream, getPreferredCommands, getTransferData, getTransferDataFlavors, isDataFlavorSupported, setCommandMap, setDataContentHandlerFactory
-
-
-
-
Constructor Detail
-
PartDataHandler
protected PartDataHandler(Part part)
-
-
Method Detail
-
getPart
public final Part getPart()
Get the MIME part linked to this data handler.- Returns:
- the MIME part
-
getDataSource
public final DataSource getDataSource()
- Overrides:
getDataSourcein classDataHandler
-
createDataSource
protected DataSource createDataSource(Part part, String contentType)
Create theDataSourceto be returned bygetDataSource(). This method may be overridden by subclasses to support customDataSourceimplementations.- Parameters:
part- thePartbacking this data handlercontentType- the content type expected to be returned byDataSource.getContentType(); defaults toapplication/octet-streamif the part doesn't specify a content type- Returns:
- the
DataSourceinstance, ornullto use the default implementation
-
writeTo
public final void writeTo(OutputStream os) throws IOException
- Overrides:
writeToin classDataHandler- Throws:
IOException
-
-