public class ClassRelativeResourceLoader extends DefaultResourceLoader
ResourceLoader implementation that interprets plain resource paths
as relative to a given java.lang.Class.Class.getResource(String),
ClassPathResource.ClassPathResource(String, Class)DefaultResourceLoader.ClassPathContextResourceCLASSPATH_URL_PREFIX| Constructor and Description |
|---|
ClassRelativeResourceLoader(Class<?> clazz)
Create a new ClassRelativeResourceLoader for the given class.
|
| Modifier and Type | Method and Description |
|---|---|
protected Resource |
getResourceByPath(String path)
Return a Resource handle for the resource at the given path.
|
getClassLoader, getResource, setClassLoaderpublic ClassRelativeResourceLoader(Class<?> clazz)
clazz - the class to load resources throughprotected Resource getResourceByPath(String path)
DefaultResourceLoaderThe 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.
getResourceByPath in class DefaultResourceLoaderpath - the path to the resourceClassPathResource,
org.springframework.context.support.FileSystemXmlApplicationContext#getResourceByPath,
org.springframework.web.context.support.XmlWebApplicationContext#getResourceByPath