URLClassLoader (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Constructor Summary
Constructors
Constructs a new named
URLClassLoaderfor the specified URLs.Constructs a new named
URLClassLoaderfor the specified URLs, parent class loader, and URLStreamHandlerFactory.Constructs a new URLClassLoader for the given URLs.
Constructs a new URLClassLoader for the specified URLs, parent class loader, and URLStreamHandlerFactory.
-
Method Summary
protected voidAppends the specified URL to the list of URLs to search for classes and resources.
voidclose()Closes this URLClassLoader, so that it can no longer be used to load new classes or resources that are defined by this loader.
Defines a new package by name in this
URLClassLoader.Finds and loads the class with the specified name from the URL search path.
Finds the resource with the specified name on the URL search path.
Returns an Enumeration of URLs representing all of the resources on the URL search path having the specified name.
Returns an input stream for reading the specified resource.
getURLs()Returns the search path of URLs for loading classes and resources.
Creates a new instance of URLClassLoader for the specified URLs and default parent class loader.
Creates a new instance of URLClassLoader for the specified URLs and parent class loader.
Methods declared in class 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, setSignersvoidSets the default assertion status for this class loader to
falseand discards any package defaults or class assertion status settings associated with the class loader.protected final Class<?> protected final Class<?> Converts an array of bytes into an instance of class
Class.protected final Class<?> Converts an array of bytes into an instance of class
Class, with a givenProtectionDomain.protected final Class<?> Converts a
ByteBufferinto an instance of classClass, with the givenProtectionDomain.Defines a package by name in this
ClassLoader.Finds the class with the given binary name in a module defined to this class loader.
Returns the absolute path name of a native library.
protected final Class<?> Returns the class with the given binary name if this loader has been recorded by the Java virtual machine as an initiating loader of a class with that binary name.
protected URLReturns a URL to a resource in a module defined to this class loader.
protected final Class<?> Finds a class with the specified binary name, loading it if necessary.
Returns the lock object for class loading operations.
Returns a
Packageof the given name that has been defined by this class loader.Returns all of the
Packages that have been defined by this class loader.Returns the name of this class loader or
nullif this class loader is not named.Returns all of the
Packages that have been defined by this class loader and its ancestors.Returns the parent class loader for delegation.
Returns the platform class loader.
Finds the resource with the given name.
Finds all the resources with the given name.
Returns the system class loader.
Find a resource of the specified name from the search path used to load classes.
Open for reading, a resource of the specified name from the search path used to load classes.
Finds all resources of the specified name from the search path used to load classes.
Returns the unnamed
Modulefor this class loader.final booleanReturns
trueif this class loader is registered as parallel capable, otherwisefalse.protected static booleanprotected final voidLinks the specified class.
Returns a stream whose elements are the URLs of all the resources with the given name.
voidSets the desired assertion status for the named top-level class in this class loader and any nested classes contained therein.
voidSets the default assertion status for this class loader.
voidSets the package default assertion status for the named package.
protected final voidSets the signers of a class.
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitCreates and returns a copy of this object.
booleanIndicates whether some other object is "equal to" this one.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.intReturns a hash code value for this object.
final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
Returns a string representation of the object.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
URLClassLoader
-
URLClassLoader
-
URLClassLoader
-
URLClassLoader
-
URLClassLoader
-
-
Method Details
-
getResourceAsStream
-
close
-
addURL
-
getURLs
-
findClass
-
definePackage
-
findResource
-
findResources
-
getPermissions
-
newInstance
-
newInstance
-