|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.io.DefaultResourceLoader org.springframework.core.io.ClassRelativeResourceLoader
public class ClassRelativeResourceLoader
ResourceLoader
implementation that interprets plain resource paths
as relative to a given java.lang.Class
.
Class.getResource(String)
,
ClassPathResource.ClassPathResource(String, Class)
Nested Class Summary | |
---|---|
private static class |
ClassRelativeResourceLoader.ClassRelativeContextResource
ClassPathResource that explicitly expresses a context-relative path through implementing the ContextResource interface. |
Field Summary | |
---|---|
private java.lang.Class |
clazz
|
Fields inherited from interface org.springframework.core.io.ResourceLoader |
---|
CLASSPATH_URL_PREFIX |
Constructor Summary | |
---|---|
ClassRelativeResourceLoader(java.lang.Class clazz)
Create a new ClassRelativeResourceLoader for the given class. |
Method Summary | |
---|---|
protected Resource |
getResourceByPath(java.lang.String path)
Return a Resource handle for the resource at the given path. |
Methods inherited from class org.springframework.core.io.DefaultResourceLoader |
---|
getClassLoader, getResource, setClassLoader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.lang.Class clazz
Constructor Detail |
---|
public ClassRelativeResourceLoader(java.lang.Class clazz)
clazz
- the class to load resources throughMethod Detail |
---|
protected Resource getResourceByPath(java.lang.String path)
DefaultResourceLoader
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.
getResourceByPath
in class DefaultResourceLoader
path
- the path to the resource
ClassPathResource
,
FileSystemXmlApplicationContext.getResourceByPath(java.lang.String)
,
AbstractRefreshableWebApplicationContext.getResourceByPath(java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |