Package org.apache.axiom.mime.activation
Class PartDataHandler
java.lang.Object
jakarta.activation.DataHandler
org.apache.axiom.mime.activation.PartDataHandler
DataHandler
implementation for MIME parts read from a stream.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DataSource
createDataSource
(Blob content, String contentType) Create theDataSource
to be returned bygetDataSource()
.final PartBlob
getBlob()
Get thePartBlob
that wraps this instance.final DataSource
final Part
getPart()
Get the MIME part linked to this data handler.final void
writeTo
(OutputStream os) Methods inherited from class jakarta.activation.DataHandler
getAllCommands, getBean, getCommand, getContent, getContentType, getInputStream, getName, getOutputStream, getPreferredCommands, getTransferData, getTransferDataFlavors, isDataFlavorSupported, setCommandMap, setDataContentHandlerFactory
-
Constructor Details
-
PartDataHandler
-
-
Method Details
-
getPart
Get the MIME part linked to this data handler.- Returns:
- the MIME part
-
getBlob
Get thePartBlob
that wraps this instance.- Returns:
- the blob wrapper
-
getDataSource
- Overrides:
getDataSource
in classDataHandler
-
createDataSource
Create theDataSource
to be returned bygetDataSource()
. This method may be overridden by subclasses to support customDataSource
implementations.- Parameters:
content
- the content of the partcontentType
- 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
- Overrides:
writeTo
in classDataHandler
- Throws:
IOException
-