mirror of
https://github.com/corda/corda.git
synced 2025-06-21 16:49:45 +00:00
Minor: add some discussion to the JavaDocs about why attachments are zip files.
This commit is contained in:
@ -12,11 +12,20 @@ import java.util.jar.JarInputStream
|
|||||||
* An attachment is a ZIP (or an optionally signed JAR) that contains one or more files. Attachments are meant to
|
* An attachment is a ZIP (or an optionally signed JAR) that contains one or more files. Attachments are meant to
|
||||||
* contain public static data which can be referenced from transactions and utilised from contracts. Good examples
|
* contain public static data which can be referenced from transactions and utilised from contracts. Good examples
|
||||||
* of how attachments are meant to be used include:
|
* of how attachments are meant to be used include:
|
||||||
|
*
|
||||||
* - Calendar data
|
* - Calendar data
|
||||||
* - Fixes (e.g. LIBOR)
|
* - Fixes (e.g. LIBOR)
|
||||||
* - Smart contract code
|
* - Smart contract code
|
||||||
* - Legal documents
|
* - Legal documents
|
||||||
* - Facts generated by oracles which might be reused a lot
|
* - Facts generated by oracles which might be reused a lot.
|
||||||
|
*
|
||||||
|
* At the moment, non-ZIP attachments are not supported. Support may come in a future release. Using ZIP files for
|
||||||
|
* attachments makes it easy to ensure data on the ledger is compressed, which is useful considering that attachments
|
||||||
|
* may be widely replicated around the network. It also allows the jarsigner tool to be used to sign an attachment
|
||||||
|
* using ordinary certificates of the kind that many organisations already have, and improves the efficiency of
|
||||||
|
* attachment resolution in cases where the attachment is logically made up of many small files - e.g. is bytecode.
|
||||||
|
* Finally, using ZIPs ensures files have a timestamp associated with them, and enables informational attachments
|
||||||
|
* to be password protected (although in current releases password protected ZIPs are likely to fail to work).
|
||||||
*/
|
*/
|
||||||
@CordaSerializable
|
@CordaSerializable
|
||||||
interface Attachment : NamedByHash {
|
interface Attachment : NamedByHash {
|
||||||
|
Reference in New Issue
Block a user