Class FilesystemResourceLoader
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.core.io.FilesystemResourceLoader
- All Implemented Interfaces:
ResourceLoader
ResourceLoader implementation that resolves plain paths as
file system resources rather than as class path resources
(the latter is DefaultResourceLoader's default strategy).
NOTE: Plain paths will always be interpreted as relative to the current VM working directory, even if they start with a slash. (This is consistent with the semantics in a servlet container.) Use an explicit "file:" prefix to enforce an absolute file path.
FilesystemXmlApplicationContext
is a full-fledged ApplicationContext implementation that provides
the same resource path resolution strategy.
- since:
- 1.1.3
- Author:
- Juergen Hoeller
- see Also:
-
Nested Class summary
Nested classes/interfaces inherited from class DefaultResourceLoader
DefaultResourceLoader.ClassPathContextResource -
Field summary
Fields inherited from interface ResourceLoader
CLAssPATH_URL_PREFIX -
Constructor summary
Constructors -
Method summary
Modifier and TypeMethodDescriptionprotected ResourcegetResourceByPath(string path) Resolve resource paths as file system paths.Methods inherited from class DefaultResourceLoader
addProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceCache, setClassLoader
-
Constructor Details
-
FilesystemResourceLoader
public FilesystemResourceLoader()
-
-
Method Details
-
getResourceByPath
Resolve resource paths as file system paths.Note: Even if a given path starts with a slash, it will get interpreted as relative to the current VM working directory.
- Overrides:
getResourceByPath in class DefaultResourceLoader- Parameters:
path- the path to the resource- Returns:
- the corresponding Resource handle
- see Also:
-