Class DirectoryClassLoader

All Implemented Interfaces:
Closeable, AutoCloseable

public class DirectoryClassLoader extends URLClassLoader
A class loader that loads classes from all jar files in a specified directory.
  • Constructor Details

    • DirectoryClassLoader

      public DirectoryClassLoader(Set<File> jarsAndDirs, ClassLoader parent)
      Initializes a new instance by the jarsAndDirs, filtered and ordered by file names.
      Parameters:
      jarsAndDirs -
      parent - - parent has higher priority.
    • DirectoryClassLoader

      public DirectoryClassLoader(File dir, ClassLoader parent)
      Create a DirectoryClassLoader to load from jar files in the specified directory, with the specified parent class loader.
      Parameters:
      dir - the directory of jar files to load from
      parent - the parent class loader
  • Method Details