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.
org.
is a full-fledged ApplicationContext implementation that provides
the same resource path resolution strategy.
DefaultResourceLoader, org.springframework.context.support.FileSystemXmlApplicationContext
| Modifier and Type | Class and Description |
|---|---|
| private static class | FileSystemResourceLoader.FileSystemContextResource
FileSystemResource that explicitly expresses a context-relative path through implementing the ContextResource interface. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Resource | Returns: the corresponding Resource handlethe path to the resource path)Overrides org. |
| FileSystemResourceLoader | back to summary |
|---|---|
| public FileSystemResourceLoader() | |
| getResourceByPath | back to summary |
|---|---|
| protected Resource getResourceByPath(String path) Overrides org. 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.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getPathWithinContext()
Implements org. |
| FileSystemContextResource | back to summary |
|---|---|
| public FileSystemContextResource(String path) | |
| getPathWithinContext | back to summary |
|---|---|
| public String getPathWithinContext() Implements org. Doc from org. Return the path within the enclosing 'context'. This is typically path relative to a context-specific root directory, e.g. a ServletContext root or a PortletContext root.
| |