Package org.apache.axiom.mime.activation

# Class PartDataHandler

java.lang.Object
jakarta.activation.DataHandler
org.apache.axiom.mime.activation.PartDataHandler

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

  Modifier and Type
  Method
  Description
  `protected DataSource`
  `createDataSource(Blob content, String contentType)`
  Create the `DataSource` to be returned by `getDataSource()`.
  `final PartBlob`
  `getBlob()`
  Get the `PartBlob` that wraps this instance.
  `final DataSource`
  `getDataSource()`
  `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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PartDataHandler

    protected PartDataHandler(Part part)

- ## Method Details

  - ### getPart

    public final Part getPart()
    Get the MIME part linked to this data handler.
    Returns:
      the MIME part

  - ### getBlob

    public final PartBlob getBlob()
    Get the `PartBlob` that wraps this instance.
    Returns:
      the blob wrapper

  - ### getDataSource

    public final DataSource getDataSource()
    Overrides:
      `getDataSource` in class `DataHandler`

  - ### createDataSource

    protected DataSource createDataSource(Blob content, String contentType)
    Create the `DataSource` to be returned by `getDataSource()`. This method may be overridden by subclasses to support custom `DataSource` implementations.
    Parameters:
      `content` - the content of the part
      `contentType` - the content type expected to be returned by `DataSource.getContentType()`; defaults to `application/octet-stream` if the part doesn't specify a content type
    Returns:
      the `DataSource` instance, or `null` to use the default implementation

  - ### writeTo

    public final void writeTo(OutputStream os) throws IOException
    Overrides:
      `writeTo` in class `DataHandler`
    Throws:
      `IOException`