Package de.sciss.util

Class DynamicURLClassLoader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class DynamicURLClassLoader
    extends java.net.URLClassLoader
    Extends java.net.URLClassLoader to be able to dynamically add URLs to the classpath. URLs can refer to a jar (ending with '.jar', they can be a classes directory (ending with '/'), they can be a single class (ending with '.class').
    • Constructor Summary

      Constructors 
      Constructor Description
      DynamicURLClassLoader()
      Creates a new class loader instance with no custom folders and jars existing.
      DynamicURLClassLoader​(java.lang.ClassLoader parent)
      Creates a new class loader instance with no custom folders and jars existing.
      DynamicURLClassLoader​(java.net.URL[] urls)
      Creates a new class loader instance with a given list of custom folders and jars.
      DynamicURLClassLoader​(java.net.URL[] urls, java.lang.ClassLoader parent)
      Creates a new class loader instance with a given list of custom folders and jars.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addURL​(java.net.URL url)
      Made a public method
      void addURLs​(java.net.URL[] urls)  
      protected java.lang.Class findClass​(java.lang.String name)  
      • Methods inherited from class java.net.URLClassLoader

        close, definePackage, 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
    • Constructor Detail

      • DynamicURLClassLoader

        public DynamicURLClassLoader()
        Creates a new class loader instance with no custom folders and jars existing. To add these, call addURL repeatedly.
      • DynamicURLClassLoader

        public DynamicURLClassLoader​(java.net.URL[] urls)
        Creates a new class loader instance with a given list of custom folders and jars.
      • DynamicURLClassLoader

        public DynamicURLClassLoader​(java.lang.ClassLoader parent)
        Creates a new class loader instance with no custom folders and jars existing. To add these, call addURL repeatedly.
      • DynamicURLClassLoader

        public DynamicURLClassLoader​(java.net.URL[] urls,
                                     java.lang.ClassLoader parent)
        Creates a new class loader instance with a given list of custom folders and jars.
    • Method Detail

      • addURL

        public void addURL​(java.net.URL url)
        Made a public method
        Overrides:
        addURL in class java.net.URLClassLoader
      • addURLs

        public void addURLs​(java.net.URL[] urls)
      • findClass

        protected java.lang.Class findClass​(java.lang.String name)
                                     throws java.lang.ClassNotFoundException
        Overrides:
        findClass in class java.net.URLClassLoader
        Throws:
        java.lang.ClassNotFoundException