Package org.springframework.core.io

# Class FileSystemResourceLoader

java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.core.io.FileSystemResourceLoader

All Implemented Interfaces:
  `ResourceLoader`

public class FileSystemResourceLoader extends DefaultResourceLoader
`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.springframework.context.support.FileSystemXmlApplicationContext` is a full-fledged ApplicationContext implementation that provides the same resource path resolution strategy.

Since:
  1.1.3
Author:
  Juergen Hoeller
See Also:
  - `DefaultResourceLoader`
  - `org.springframework.context.support.FileSystemXmlApplicationContext`

## Nested Class Summary

## Nested classes/interfaces inherited from class org.springframework.core.io.DefaultResourceLoader

`DefaultResourceLoader.ClassPathContextResource`

## Field Summary

### Fields inherited from interface org.springframework.core.io.ResourceLoader

`CLASSPATH_URL_PREFIX`

## Constructor Summary

Constructors
Constructor
Description
`FileSystemResourceLoader()`

## Method Summary

Modifier and Type
Method
Description
`protected Resource`
`getResourceByPath(String path)`
Resolve resource paths as file system paths.

### Methods inherited from class org.springframework.core.io.DefaultResourceLoader

`addProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceCache, setClassLoader`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### FileSystemResourceLoader

public FileSystemResourceLoader()

## Method Details

### getResourceByPath

protected Resource getResourceByPath(String path)
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:
  - `FileSystemResource`
  - `org.springframework.web.context.support.ServletContextResourceLoader#getResourceByPath`