public class PublicURLClassLoader
extends java.net.URLClassLoader
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
nativePath |
static java.lang.ClassLoader |
systemclassloader |
| Constructor and Description |
|---|
PublicURLClassLoader(java.net.URL[] urls)
Constructs a new URLClassLoader for the specified URLs using the
default delegation parent
ClassLoader. |
PublicURLClassLoader(java.net.URL[] urls,
java.lang.ClassLoader parent)
Constructs a new URLClassLoader for the given URLs.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addURL(java.net.URL url) |
java.lang.String |
findLibrary(java.lang.String name) |
static java.lang.ClassLoader |
getSystemClassLoader() |
close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic static java.lang.ClassLoader systemclassloader
public java.lang.String nativePath
public PublicURLClassLoader(java.net.URL[] urls)
ClassLoader. The URLs will
be searched in the order specified for classes and resources after
first searching in the parent class loader. Any URL that ends with
a '/' is assumed to refer to a directory. Otherwise, the URL is
assumed to refer to a JAR file which will be downloaded and opened
as needed.
If there is a security manager, this method first
calls the security manager's checkCreateClassLoader method
to ensure creation of a class loader is allowed.
urls - the URLs from which to load classes and resourcesjava.lang.SecurityException - if a security manager exists and its
checkCreateClassLoader method doesn't allow
creation of a class loader.java.lang.NullPointerException - if urls is null.SecurityManager.checkCreateClassLoader()public PublicURLClassLoader(java.net.URL[] urls,
java.lang.ClassLoader parent)
jar:
scheme URL is assumed to refer to a JAR file. Any file: scheme
URL that ends with a '/' is assumed to refer to a directory. Otherwise,
the URL is assumed to refer to a JAR file which will be downloaded and
opened as needed.
If there is a security manager, this method first
calls the security manager's checkCreateClassLoader method
to ensure creation of a class loader is allowed.
urls - the URLs from which to load classes and resourcesparent - the parent class loader for delegationjava.lang.SecurityException - if a security manager exists and its
checkCreateClassLoader method doesn't allow
creation of a class loader.java.lang.NullPointerException - if urls is null.SecurityManager.checkCreateClassLoader()public static java.lang.ClassLoader getSystemClassLoader()
public java.lang.String findLibrary(java.lang.String name)
findLibrary in class java.lang.ClassLoaderpublic void addURL(java.net.URL url)
addURL in class java.net.URLClassLoader