Module ij
Package ij.io

# Class PluginClassLoader

java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
ij.io.PluginClassLoader

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public class PluginClassLoader extends URLClassLoader
ImageJ uses this class loader to load plugins and resources from the plugins directory and immediate subdirectories. This class loader will also load classes and resources from JAR files.

The class loader searches for classes and resources in the following order:

1. Plugins directory
2. Subdirectories of the Plugins directory
3. JAR and ZIP files in the plugins directory and subdirectories

The class loader does not recurse into subdirectories beyond the first level.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`path`

## Constructor Summary

Constructors
Constructor
Description
`PluginClassLoader(String path)`
Creates a new PluginClassLoader that searches in the directory path passed as a parameter.
`PluginClassLoader(String path, boolean callSuper)`
This version of the constructor is used when ImageJ is launched using Java WebStart.

## Method Summary

### Methods inherited from class java.net.URLClassLoader

`addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance`

### Methods inherited from class java.security.SecureClassLoader

`defineClass, defineClass`

### Methods inherited from class java.lang.ClassLoader

`clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### path

protected String path

## Constructor Details

### PluginClassLoader

public PluginClassLoader(String path)
Creates a new PluginClassLoader that searches in the directory path passed as a parameter. The constructor automatically finds all JAR and ZIP files in the path and first level of subdirectories. The JAR and ZIP files are stored in a Vector for future searches.

Parameters:
  `path` - the path to the plugins directory.

### PluginClassLoader

public PluginClassLoader(String path, boolean callSuper)
This version of the constructor is used when ImageJ is launched using Java WebStart.