Top Description Inners Constructors Methods
org.springframework.core.io

public Class FileSystemResourceLoader

extends DefaultResourceLoader
Class Inheritance

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.

Author
Juergen Hoeller
Since
1.1.3
See Also
DefaultResourceLoader, org.springframework.context.support.FileSystemXmlApplicationContext

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
FileSystemResourceLoader.FileSystemContextResource

FileSystemResource that explicitly expresses a context-relative path through implementing the ContextResource interface.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Resource

Returns:

the corresponding Resource handle
getResourceByPath
(String
the path to the resource
path
)

Overrides org.springframework.core.io.DefaultResourceLoader.getResourceByPath.

Resolve resource paths as file system paths.
Inherited from org.springframework.core.io.DefaultResourceLoader:
addProtocolResolverclearResourceCachesgetClassLoadergetProtocolResolversgetResourcegetResourceCachesetClassLoader

Constructor Detail

FileSystemResourceLoaderback to summary
public FileSystemResourceLoader()

Method Detail

getResourceByPathback to summary
protected Resource getResourceByPath(String path)

Overrides org.springframework.core.io.DefaultResourceLoader.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.

Parameters
path:String

the path to the resource

Returns:Resource

the corresponding Resource handle

Annotations
@Override
See Also
FileSystemResource, org.springframework.web.context.support.ServletContextResourceLoader#getResourceByPath
org.springframework.core.io back to summary

private Class FileSystemResourceLoader.FileSystemContextResource

extends FileSystemResource
implements ContextResource
Class Inheritance
All Implemented Interfaces
org.springframework.core.io.ContextResource, org.springframework.core.io.Resource, org.springframework.core.io.InputStreamSource

FileSystemResource that explicitly expresses a context-relative path through implementing the ContextResource interface.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getPathWithinContext()

Implements org.springframework.core.io.ContextResource.getPathWithinContext.

Return the path within the enclosing 'context'.
Inherited from org.springframework.core.io.FileSystemResource:
contentLengthcreateRelativeequalsexistsgetContentAsByteArraygetContentAsStringgetDescriptiongetFilegetFilenamegetInputStreamgetOutputStreamgetPathgetURIgetURLhashCodeisFileisReadableisWritablelastModifiedreadableChannelwritableChannel

Constructor Detail

FileSystemContextResourceback to summary
public FileSystemContextResource(String path)

Method Detail

getPathWithinContextback to summary
public String getPathWithinContext()

Implements org.springframework.core.io.ContextResource.getPathWithinContext.

Doc from org.springframework.core.io.ContextResource.getPathWithinContext.

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.

Annotations
@Override