Class ClasspathClassLoader

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

    public class ClasspathClassLoader
    extends java.net.URLClassLoader
    Create a ClassLoader which loads classes using a CLASSPATH like String. If the String looks like a URL to a file (e.g. starts with file://) the file will be read with each line representing an path on the classpath.
    Author:
    Edwin Chan
    • Constructor Summary

      Constructors 
      Constructor Description
      ClasspathClassLoader​(java.lang.String classpath, java.lang.ClassLoader parent)  
      ClasspathClassLoader​(java.util.List<java.io.File> files, java.lang.ClassLoader parent)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Class<?> loadClass​(java.lang.String name, boolean resolve)  
      java.lang.String toString()  
      • 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, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ClasspathClassLoader

        public ClasspathClassLoader​(java.util.List<java.io.File> files,
                                    java.lang.ClassLoader parent)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • ClasspathClassLoader

        public ClasspathClassLoader​(java.lang.String classpath,
                                    java.lang.ClassLoader parent)
                             throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • loadClass

        protected java.lang.Class<?> loadClass​(java.lang.String name,
                                               boolean resolve)
                                        throws java.lang.ClassNotFoundException
        Overrides:
        loadClass in class java.lang.ClassLoader
        Throws:
        java.lang.ClassNotFoundException