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
DataHandler
implementation for MIME parts read from a stream.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PartDataHandler(Part part)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DataSource
createDataSource(Part part, String contentType)
Create theDataSource
to be returned bygetDataSource()
.DataSource
getDataSource()
Part
getPart()
Get the MIME part linked to this data handler.void
writeTo(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:
getDataSource
in classDataHandler
-
createDataSource
protected DataSource createDataSource(Part part, String contentType)
Create theDataSource
to be returned bygetDataSource()
. This method may be overridden by subclasses to support customDataSource
implementations.- Parameters:
part
- thePart
backing this data handlercontentType
- the content type expected to be returned byDataSource.getContentType()
; defaults toapplication/octet-stream
if the part doesn't specify a content type- Returns:
- the
DataSource
instance, ornull
to use the default implementation
-
writeTo
public final void writeTo(OutputStream os) throws IOException
- Overrides:
writeTo
in classDataHandler
- Throws:
IOException
-
-