Class ClassRelativeResourceLoader
- java.lang.Object
-
- org.hotswap.agent.util.spring.io.loader.DefaultResourceLoader
-
- org.hotswap.agent.util.spring.io.loader.ClassRelativeResourceLoader
-
- All Implemented Interfaces:
ResourceLoader
public class ClassRelativeResourceLoader extends DefaultResourceLoader
ResourceLoaderimplementation that interprets plain resource paths as relative to a givenjava.lang.Class.- Since:
- 3.0
- Author:
- Juergen Hoeller
- See Also:
Class.getResource(String),ClassPathResource(String, Class)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hotswap.agent.util.spring.io.loader.DefaultResourceLoader
DefaultResourceLoader.ClassPathContextResource
-
-
Field Summary
-
Fields inherited from interface org.hotswap.agent.util.spring.io.loader.ResourceLoader
CLASSPATH_URL_PREFIX
-
-
Constructor Summary
Constructors Constructor Description ClassRelativeResourceLoader(Class<?> clazz)Create a new ClassRelativeResourceLoader for the given class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ResourcegetResourceByPath(String path)Return a Resource handle for the resource at the given path.-
Methods inherited from class org.hotswap.agent.util.spring.io.loader.DefaultResourceLoader
getClassLoader, getResource, setClassLoader
-
-
-
-
Constructor Detail
-
ClassRelativeResourceLoader
public ClassRelativeResourceLoader(Class<?> clazz)
Create a new ClassRelativeResourceLoader for the given class.- Parameters:
clazz- the class to load resources through
-
-
Method Detail
-
getResourceByPath
protected Resource getResourceByPath(String path)
Description copied from class:DefaultResourceLoaderReturn a Resource handle for the resource at the given path.The default implementation supports class path locations. This should be appropriate for standalone implementations but can be overridden, e.g. for implementations targeted at a Servlet container.
- Overrides:
getResourceByPathin classDefaultResourceLoader- Parameters:
path- the path to the resource- Returns:
- the corresponding Resource handle
- See Also:
ClassPathResource,org.springframework.context.support.FileSystemXmlApplicationContext#getResourceByPath,org.springframework.web.context.support.XmlWebApplicationContext#getResourceByPath
-
-