Package org.springframework.core.io
Class ClassRelativeResourceLoader
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.core.io.ClassRelativeResourceLoader
- All Implemented Interfaces:
- ResourceLoader
ResourceLoader implementation that interprets plain resource paths
 as relative to a given java.lang.Class.- Since:
- 3.0
- Author:
- Juergen Hoeller
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.core.io.DefaultResourceLoaderDefaultResourceLoader.ClassPathContextResource
- 
Field SummaryFields inherited from interface org.springframework.core.io.ResourceLoaderCLASSPATH_URL_PREFIX
- 
Constructor SummaryConstructorsConstructorDescriptionClassRelativeResourceLoader(Class<?> clazz) Create a new ClassRelativeResourceLoader for the given class.
- 
Method SummaryModifier and TypeMethodDescriptionprotected ResourcegetResourceByPath(String path) Return a Resource handle for the resource at the given path.Methods inherited from class org.springframework.core.io.DefaultResourceLoaderaddProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceCache, setClassLoader
- 
Constructor Details- 
ClassRelativeResourceLoaderCreate a new ClassRelativeResourceLoader for the given class.- Parameters:
- clazz- the class to load resources through
 
 
- 
- 
Method Details- 
getResourceByPathDescription 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, for example, for implementations targeted at a Servlet container. - Overrides:
- getResourceByPathin class- DefaultResourceLoader
- Parameters:
- path- the path to the resource
- Returns:
- the corresponding Resource handle
- See Also:
 
 
-