com.mindbright.util
public class JarLoader extends java.lang.ClassLoader
ClassLoader
which can load classes from a jar-file.Constructor and Description |
---|
JarLoader(java.lang.String path,
java.lang.String name)
Construct an instance which looks for a jar-file with the given
name somewhere in the given path.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class |
findClass(java.lang.String name)
Finds the class with the specified name.
|
java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
Loads the given class.
|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public JarLoader(java.lang.String path, java.lang.String name) throws java.io.IOException
path
- a list of directories, separated by ':' or ';', to
search in.name
- name, including suffix, of jarfile to look forjava.io.IOException
- if no jarfile with that name was foundpublic java.lang.Class findClass(java.lang.String name) throws java.lang.ClassNotFoundException
findClass
in class java.lang.ClassLoader
name
- the name of the class to findjava.lang.ClassNotFoundException
- if no matching class is foundpublic java.lang.Class loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
name
- the name of the class to loadresolve
- true of the class should be resolved as welljava.lang.ClassNotFoundException
- if no matching class is found