com.r3corda.core.node.services / AttachmentStorage

# AttachmentStorage

`interface AttachmentStorage`

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

### Functions

importAttachment | `abstract fun importAttachment(jar: InputStream): SecureHash` 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.
openAttachment | `abstract fun openAttachment(id: SecureHash): Attachment?` Returns a handle to a locally stored attachment, or null if its not known. The handle can be used to open a stream for the data, which will be a zip/jar file.

### Inheritors

NodeAttachmentService | `class NodeAttachmentService : AttachmentStorage, AcceptsFileUpload` Stores attachments in the specified local directory, which must exist. Doesnt allow new attachments to be uploaded.