Package org.apache.axiom.util.activation

# Class DataHandlerUtils

java.lang.Object
org.apache.axiom.util.activation.DataHandlerUtils

public final class DataHandlerUtils extends Object
Contains utility methods to work with `DataHandler` objects.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DataHandler`
  `getDataHandler(Blob blob)`
  Get the `DataHandler` wrapped by the given `Blob`.
  `static Blob`
  `toBlob(DataHandler dh)`
  Get a `Blob` for the given `DataHandler`.
  `static DataHandler`
  `toDataHandler(Blob blob)`
  Get a `DataHandler` for the given `Blob`.

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

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

- ## Method Details

  - ### getDataHandler

    public static DataHandler getDataHandler(Blob blob)
    Get the `DataHandler` wrapped by the given `Blob`.
    Parameters:
      `blob` - the `Blob` to unwrap
    Returns:
      the wrapped `DataHandler`, or `null` if the blob doesn't wrap a `DataHandler`

  - ### toDataHandler

    public static DataHandler toDataHandler(Blob blob)
    Get a `DataHandler` for the given `Blob`. If the blob was obtained from `toBlob(DataHandler)`, the original `DataHandler` is returned.
    Parameters:
      `blob` - the `Blob` to convert
    Returns:
      a `DataHandler` representing the `Blob`

  - ### toBlob

    public static Blob toBlob(DataHandler dh)
    Get a `Blob` for the given `DataHandler`. If the `DataHandler` was obtained from `toDataHandler(Blob)`, the original `Blob` is returned.
    Parameters:
      `dh` - the `DataHandler` to convert
    Returns:
      a `Blob` representing the `DataHandler`