net.corda.core.contracts

## Interface Attachment

- All Superinterfaces:
    NamedByHash

      public Attachment
      extends NamedByHash

  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 of how attachments are meant to be used include:

  - Calendar data

  - Fixes (e.g. LIBOR)

  - Smart contract code

  - Legal documents

  - Facts generated by oracles which might be reused a lot

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `Attachment.DefaultImpls` 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 of how attachments are meant to be used include:

  - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `extractFile(java.lang.String path, java.io.OutputStream outputTo)` Finds the named file case insensitively and copies it to the output stream.
    `java.io.InputStream` | `open()`
    `java.util.jar.JarInputStream` | `openAsJAR()`

    - ### Methods inherited from interface net.corda.core.contracts.NamedByHash

      `getId`

- - ### Method Detail

    - #### open

          java.io.InputStream open()

    - #### openAsJAR

          java.util.jar.JarInputStream openAsJAR()

    - #### extractFile

          void extractFile(java.lang.String path,
                           java.io.OutputStream outputTo)

      Finds the named file case insensitively and copies it to the output stream.

      Throws:
        - if the given path doesn't exist in the attachment.