public class OwnResFirstClassLoader
extends java.net.URLClassLoader
URLClassLoader that tries to retrieve resources within the
own classpaths first before asking the parent classloader. Therefore the own
resources are preferred to the ones of the parent classloader.| Constructor and Description |
|---|
OwnResFirstClassLoader(java.net.URL[] urls,
java.lang.ClassLoader parent)
Constructs a new classloader for the designated URLs.
|
| Modifier and Type | Method and Description |
|---|---|
java.net.URL |
getResource(java.lang.String name)
Finds the designated resource within the URLs
of this classloader first. |
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic OwnResFirstClassLoader(java.net.URL[] urls,
java.lang.ClassLoader parent)
URLClassLoader except that resources are tried to retrieve
from these URLs before delegating to the designated parent classloader.urls - The URLs from which to load classes and resources.parent - The parent class loader for delegation.SecurityManager.checkCreateClassLoader()