Package org.apache.axiom.attachments

# Class ConfigurableDataHandler

java.lang.Object
jakarta.activation.DataHandler
org.apache.axiom.attachments.ConfigurableDataHandler

public class ConfigurableDataHandler extends DataHandler
This Axiom DataHandler inplementation allows the user to set custom values for the following MIME body part headers.

- content-transfer-encoding
- content-type

Data written to the MIME part gets encoded by content-transfer-encoding specified as above

Usage is Similar to the javax.activation.DataHandler except for the setting of the above properties.

eg:

dataHandler = new ConfigurableDataHandler(new ByteArrayDataSource(byteArray));

dataHandler.setTransferEncoding("quoted-printable");

dataHandler.setContentType("image/jpg");

See Also:
  - `DataHandler`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final ContentTransferEncodingPolicy`
  `CONTENT_TRANSFER_ENCODING_POLICY`
  `ContentTransferEncodingPolicy` implementation that recognizes blobs created from `ConfigurableDataHandler` objects and returns the content transfer encoding set using `setTransferEncoding(String)`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConfigurableDataHandler(DataSource ds)`
  `ConfigurableDataHandler(Object data, String type)`
  `ConfigurableDataHandler(URL url)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getContentType()`
  `String`
  `getTransferEncoding()`
  `void`
  `setContentType(String contentType)`
  `void`
  `setTransferEncoding(String transferEncoding)`

  ### Methods inherited from class jakarta.activation.DataHandler

  `getAllCommands, getBean, getCommand, getContent, getDataSource, getInputStream, getName, getOutputStream, getPreferredCommands, getTransferData, getTransferDataFlavors, isDataFlavorSupported, setCommandMap, setDataContentHandlerFactory, writeTo`

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

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

- ## Field Details

  - ### CONTENT_TRANSFER_ENCODING_POLICY

    public static final ContentTransferEncodingPolicy CONTENT_TRANSFER_ENCODING_POLICY
    `ContentTransferEncodingPolicy` implementation that recognizes blobs created from `ConfigurableDataHandler` objects and returns the content transfer encoding set using `setTransferEncoding(String)`.

- ## Constructor Details

  - ### ConfigurableDataHandler

    public ConfigurableDataHandler(DataSource ds)

  - ### ConfigurableDataHandler

    public ConfigurableDataHandler(Object data, String type)

  - ### ConfigurableDataHandler

    public ConfigurableDataHandler(URL url)

- ## Method Details

  - ### getContentType

    public String getContentType()
    Overrides:
      `getContentType` in class `DataHandler`

  - ### setContentType

    public void setContentType(String contentType)

  - ### getTransferEncoding

    public String getTransferEncoding()

  - ### setTransferEncoding

    public void setTransferEncoding(String transferEncoding)