public AttachmentStorage
An attachment store records potentially large binary objects, identified by their hash.
Modifier and Type | Interface and Description |
---|---|
static class |
AttachmentStorage.DefaultImpls
An attachment store records potentially large binary objects, identified by their hash.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<net.corda.core.crypto.SecureHash> |
getLatestContractAttachments(java.lang.String contractClassName,
int minContractVersion)
Find the Attachment Id(s) of the contract attachments with the highest version for a given contract class name
from trusted upload sources.
Return highest version of both signed and unsigned attachment ids (signed first, unsigned second), otherwise return a
single signed or unsigned version id, or an empty list if none meet the criteria.
|
boolean |
hasAttachment(SecureHash attachmentId)
Searches for an attachment already in the store
|
SecureHash |
importAttachment(java.io.InputStream jar)
Deprecated.
|
SecureHash |
importAttachment(java.io.InputStream jar,
java.lang.String uploader,
java.lang.String filename)
Inserts the given attachment with additional metadata, see
AttachmentStorage.importAttachment for input stream handling
Extra parameters: |
SecureHash |
importOrGetAttachment(java.io.InputStream jar)
Deprecated.
|
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.
|
java.util.List<net.corda.core.crypto.SecureHash> |
queryAttachments(AttachmentQueryCriteria criteria,
AttachmentSort sorting)
Searches attachment using given criteria and optional sort rules
|
java.util.List<net.corda.core.crypto.SecureHash> |
queryAttachments(AttachmentQueryCriteria criteria) |
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.
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 java.util.jar.JarInputStream into this method and it will throw if you do, because access to the raw byte stream is required.
SecureHash importAttachment(java.io.InputStream jar, java.lang.String uploader, java.lang.String filename)
Inserts the given attachment with additional metadata, see AttachmentStorage.importAttachment
for input stream handling
Extra parameters:
uploader
- Uploader namefilename
- Name of the fileAttachmentStorage.importAttachment
SecureHash importOrGetAttachment(java.io.InputStream jar)
Inserts or returns Attachment Id of attachment. Does not throw an exception if already uploaded.
jar
- InputStream of Jar filejava.util.List<net.corda.core.crypto.SecureHash> queryAttachments(AttachmentQueryCriteria criteria, AttachmentSort sorting)
Searches attachment using given criteria and optional sort rules
criteria
- Query criteria to use as a filtersorting
- Sorting definition, if not given, order is undefinedboolean hasAttachment(SecureHash attachmentId)
Searches for an attachment already in the store
attachmentId
- The attachment Idjava.util.List<net.corda.core.crypto.SecureHash> queryAttachments(AttachmentQueryCriteria criteria)
java.util.List<net.corda.core.crypto.SecureHash> getLatestContractAttachments(java.lang.String contractClassName, int minContractVersion)
Find the Attachment Id(s) of the contract attachments with the highest version for a given contract class name from trusted upload sources. Return highest version of both signed and unsigned attachment ids (signed first, unsigned second), otherwise return a single signed or unsigned version id, or an empty list if none meet the criteria.
contractClassName
- The fully qualified name of the contract class.minContractVersion
- The minimum contract version that should be returned.