public class

ResourceOverridingShadowingClassLoader

extends ShadowingClassLoader
java.lang.Object
   ↳ java.lang.ClassLoader
     ↳ org.springframework.core.DecoratingClassLoader
       ↳ org.springframework.instrument.classloading.ShadowingClassLoader
         ↳ org.springframework.instrument.classloading.ResourceOverridingShadowingClassLoader

Class Overview

Subclass of ShadowingClassLoader that overrides attempts to locate certain files.

Summary

[Expand]
Inherited Fields
From class org.springframework.instrument.classloading.ShadowingClassLoader
Public Constructors
ResourceOverridingShadowingClassLoader(ClassLoader enclosingClassLoader)
Create a new ResourceOverridingShadowingClassLoader, decorating the given ClassLoader.
Public Methods
void copyOverrides(ResourceOverridingShadowingClassLoader other)
Copy all overrides from the given ClassLoader.
URL getResource(String requestedPath)
InputStream getResourceAsStream(String requestedPath)
Enumeration<URL> getResources(String requestedPath)
void override(String oldPath, String newPath)
Return the resource (if any) at the new path on an attempt to locate a resource at the old path.
void suppress(String oldPath)
Ensure that a resource with the given path is not found.
[Expand]
Inherited Methods
From class org.springframework.instrument.classloading.ShadowingClassLoader
From class org.springframework.core.DecoratingClassLoader
From class java.lang.ClassLoader
From class java.lang.Object

Public Constructors

public ResourceOverridingShadowingClassLoader (ClassLoader enclosingClassLoader)

Create a new ResourceOverridingShadowingClassLoader, decorating the given ClassLoader.

Parameters
enclosingClassLoader the ClassLoader to decorate

Public Methods

public void copyOverrides (ResourceOverridingShadowingClassLoader other)

Copy all overrides from the given ClassLoader.

Parameters
other the other ClassLoader to copy from

public URL getResource (String requestedPath)

public InputStream getResourceAsStream (String requestedPath)

public Enumeration<URL> getResources (String requestedPath)

Throws
IOException

public void override (String oldPath, String newPath)

Return the resource (if any) at the new path on an attempt to locate a resource at the old path.

Parameters
oldPath the path requested
newPath the actual path to be looked up

public void suppress (String oldPath)

Ensure that a resource with the given path is not found.

Parameters
oldPath the path of the resource to hide even if it exists in the parent ClassLoader