org.apache.axiom.om.impl.builder

## Class AttachmentsMimePartProvider

- java.lang.Object
- - org.apache.axiom.om.impl.builder.AttachmentsMimePartProvider

- All Implemented Interfaces:
    Detachable, MimePartProvider

      public class AttachmentsMimePartProvider
      extends Object
      implements MimePartProvider, Detachable

  Adapts an `Attachments` instance to the `MimePartProvider` interface.

  For internal use only.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AttachmentsMimePartProvider(Attachments attachments)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `detach()`
    `javax.activation.DataHandler` | `getDataHandler(String contentID)` Get the `DataHandler` for the MIME part identified by a given content ID.
    `boolean` | `isLoaded(String contentID)` Check whether the MIME part identified by a given content ID has already been loaded.

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

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

- - ### Constructor Detail

    - #### AttachmentsMimePartProvider

          public AttachmentsMimePartProvider(Attachments attachments)

  - ### Method Detail

    - #### isLoaded

          public boolean isLoaded(String contentID)

      Description copied from interface: `MimePartProvider`
      Check whether the MIME part identified by a given content ID has already been loaded. A return value of `true` means that a call to `MimePartProvider.getDataHandler(String)` (for the same content ID) will not block or will retrieve the `DataHandler` without overhead.
      Specified by:
        `isLoaded` in interface `MimePartProvider`
      Returns:
        `true` if the MIME part has already been loaded; `false` otherwise

    - #### getDataHandler

          public javax.activation.DataHandler getDataHandler(String contentID)
                                                      throws IOException

      Description copied from interface: `MimePartProvider`
      Get the `DataHandler` for the MIME part identified by a given content ID.
      Specified by:
        `getDataHandler` in interface `MimePartProvider`
      Parameters:
        `contentID` - a content ID referenced in an `xop:Include` element
      Returns:
        the `DataHandler` for the MIME part identified by the content ID; may not be `null`
      Throws:
        `IOException` - if an error occurred while loading the part

    - #### detach

          public void detach()

      Specified by:
        `detach` in interface `Detachable`

Copyright © The Apache Software Foundation. All Rights Reserved.