public class JarClassLoader extends SecureClassLoader
| Constructor and Description |
|---|
JarClassLoader(IJarFile jar,
ClassLoader parent)
Creates the Jar file class loader using the default parent class loader for delegation.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addJar(JarFile jar)
Adds an entry to a Jar file.
|
protected Class<?> |
findClass(String name)
Finds the class with the specified binary name.
|
URL |
findResource(String name)
Finds the resource with the given name.
|
Enumeration<URL> |
findResources(String name)
Returns an enumeration of
URL objects
representing all the resources with the given name. |
static JarFile |
getJar(String jarFileName)
Gets a Jar file from an URL.
|
InputStream |
getResourceAsStream(String name)
Open for reading, a resource of the specified name from the search path used to load classes.
|
defineClass, defineClass, getPermissionsclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic JarClassLoader(IJarFile jar, ClassLoader parent) throws IOException
jar - the Jar file for the class path.parent - the Parent class loader.IOExceptionpublic static void addJar(JarFile jar)
jar - Thepublic static JarFile getJar(String jarFileName)
jarFileName - The Jar file name.null
if not found or garbage collected.protected Class<?> findClass(String name) throws ClassNotFoundException
findClass in class ClassLoadername - The binary name of the classClassNotFoundException - If the class could not be found.ClassLoader.findClass(java.lang.String)public URL findResource(String name)
findResource in class ClassLoadername - The resource namepublic Enumeration<URL> findResources(String name) throws IOException
URL objects
representing all the resources with the given name. Class loader
implementations should override this method to specify where to load
resources from.findResources in class ClassLoadername - The resource nameURL objects for
the resourcesIOException - If I/O errors occurpublic InputStream getResourceAsStream(String name)
getResourceAsStream in class ClassLoadername - the name of the resource.ClassLoader.getResourceAsStream(java.lang.String)Phantom® and NetPhantom® are registered trademarks of Nexum International SARL.
© Copyright Nexum International SARL, 2019. All rights reserved.