interface AttachmentStorage
An attachment store records potentially large binary objects, identified by their hash. Note that attachments are immutable and can never be erased once inserted
importAttachment |
abstract fun importAttachment(jar: InputStream): SecureHash Inserts the given attachment into the store, does |
openAttachment |
abstract fun openAttachment(id: SecureHash): Attachment? Returns a newly opened stream for the given locally stored attachment, or null if no such attachment is known. The returned stream must be closed when you are done with it to avoid resource leaks. You should probably wrap the result in a JarInputStream unless youre sending it somewhere, there is a convenience helper for this on Attachment. |
MockAttachmentStorage |
class MockAttachmentStorage : AttachmentStorage |
NodeAttachmentService |
class NodeAttachmentService : AttachmentStorage, AcceptsFileUpload Stores attachments in the specified local directory, which must exist. Doesnt allow new attachments to be uploaded. |