Package pro.gravit.utils
Class PublicURLClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
pro.gravit.utils.PublicURLClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionPublicURLClassLoader(URL[] urls) Constructs a new URLClassLoader for the specified URLs using the default delegation parentClassLoader.PublicURLClassLoader(URL[] urls, ClassLoader parent) Constructs a new URLClassLoader for the given URLs. -
Method Summary
Methods inherited from class java.net.URLClassLoader
close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods 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
-
Constructor Details
-
PublicURLClassLoader
Constructs a new URLClassLoader for the specified URLs using the default delegation parentClassLoader. 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
checkCreateClassLoadermethod to ensure creation of a class loader is allowed.- Parameters:
urls- the URLs from which to load classes and resources- Throws:
SecurityException- if a security manager exists and itscheckCreateClassLoadermethod doesn't allow creation of a class loader.NullPointerException- ifurlsisnull.- See Also:
-
PublicURLClassLoader
Constructs a new URLClassLoader for the given URLs. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader. Anyjar:scheme URL is assumed to refer to a JAR file. Anyfile: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
checkCreateClassLoadermethod to ensure creation of a class loader is allowed.- Parameters:
urls- the URLs from which to load classes and resourcesparent- the parent class loader for delegation- Throws:
SecurityException- if a security manager exists and itscheckCreateClassLoadermethod doesn't allow creation of a class loader.NullPointerException- ifurlsisnull.- See Also:
-
-
Method Details
-
addURL
- Overrides:
addURLin classURLClassLoader
-