public class

FileSystemResourceLoader

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

Class Overview

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.

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.io.ResourceLoader
Public Constructors
FileSystemResourceLoader()
Protected Methods
Resource getResourceByPath(String path)
Resolve resource paths as file system paths.
[Expand]
Inherited Methods
From class org.springframework.core.io.DefaultResourceLoader
From class java.lang.Object
From interface org.springframework.core.io.ResourceLoader

Public Constructors

public FileSystemResourceLoader ()

Also: SpringCore

Protected Methods

protected Resource getResourceByPath (String path)

Also: SpringCore

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.

Parameters
path the path to the resource
Returns
  • the corresponding Resource handle