corda / net.corda.core.node / AttachmentsClassLoader

# AttachmentsClassLoader

`class AttachmentsClassLoader : SecureClassLoader`

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.

### Exceptions

OverlappingAttachments | `class OverlappingAttachments : Exception`

### Constructors

<init> | `AttachmentsClassLoader(attachments: List<Attachment>, parent: ClassLoader = ClassLoader.getSystemClassLoader())` 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.

### Functions

findClass | `fun findClass(name: String): Class<*>`
findResource | `fun findResource(name: String): URL?`
getResourceAsStream | `fun getResourceAsStream(name: String): InputStream?`