net.corda.core.node

## Class AttachmentsClassLoader

- net.corda.core.node.AttachmentsClassLoader

-     public class AttachmentsClassLoader

  A custom ClassLoader that knows how to load classes from a set of attachments. The attachments themselves only need to provide JAR streams, and so could be fetched from a database, local disk, etc. Constructing an AttachmentsClassLoader is somewhat expensive, as every attachment is scanned to ensure that there are no overlapping file paths.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AttachmentsClassLoader(java.util.List<? extends net.corda.core.contracts.Attachment> attachments, java.lang.ClassLoader parent)` A custom ClassLoader that knows how to load classes from a set of attachments. The attachments themselves only need to provide JAR streams, and so could be fetched from a database, local disk, etc. Constructing an AttachmentsClassLoader is somewhat expensive, as every attachment is scanned to ensure that there are no overlapping file paths.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Class<?>` | `findClass(java.lang.String name)`
    `java.net.URL` | `findResource(java.lang.String name)`
    `java.io.InputStream` | `getResourceAsStream(java.lang.String name)`

- - ### Constructor Detail

    - #### AttachmentsClassLoader

          public AttachmentsClassLoader(java.util.List<? extends net.corda.core.contracts.Attachment> attachments,
                                        java.lang.ClassLoader parent)

      A custom ClassLoader that knows how to load classes from a set of attachments. The attachments themselves only need to provide JAR streams, and so could be fetched from a database, local disk, etc. Constructing an AttachmentsClassLoader is somewhat expensive, as every attachment is scanned to ensure that there are no overlapping file paths.

  - ### Method Detail

    - #### findClass

          public java.lang.Class<?> findClass(java.lang.String name)

    - #### findResource

          public java.net.URL findResource(java.lang.String name)

    - #### getResourceAsStream

          public java.io.InputStream getResourceAsStream(java.lang.String name)