net.corda.core.node.services

## Interface AttachmentStorage

- All Known Implementing Classes:
    NodeAttachmentService

      public AttachmentStorage

  An attachment store records potentially large binary objects, identified by their hash.

- - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `SecureHash` | `importAttachment(java.io.InputStream jar)` Inserts the given attachment into the store, does not close the input stream. This can be an intensive operation due to the need to copy the bytes to disk and hash them along the way.
    `Attachment` | `openAttachment(SecureHash id)` Returns a handle to a locally stored attachment, or null if it's not known. The handle can be used to open a stream for the data, which will be a zip/jar file.

- - ### Method Detail

    - #### openAttachment

          Attachment openAttachment(SecureHash id)

      Returns a handle to a locally stored attachment, or null if it's not known. The handle can be used to open a stream for the data, which will be a zip/jar file.

    - #### importAttachment

          SecureHash importAttachment(java.io.InputStream jar)

      Inserts the given attachment into the store, does not close the input stream. This can be an intensive operation due to the need to copy the bytes to disk and hash them along the way.

      Note that you should not pass a JarInputStream into this method and it will throw if you do, because access to the raw byte stream is required.

      Throws:
        - if the given byte stream has already been inserted.
        - if the given byte stream is empty or a JarInputStream.
        - if something went wrong.
      See Also:
        JarInputStream