java.lang.Object | |
↳ | org.springframework.core.io.DefaultResourceLoader |
Known Direct Subclasses |
Default implementation of the ResourceLoader
interface.
Used by ResourceEditor
, and serves as base class for
AbstractApplicationContext
.
Can also be used standalone.
Will return a UrlResource
if the location value is a URL,
and a ClassPathResource
if it is a non-URL path or a
"classpath:" pseudo-URL.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.springframework.core.io.ResourceLoader
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new DefaultResourceLoader.
| |||||||||||
Create a new DefaultResourceLoader.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the ClassLoader to load class path resources with.
| |||||||||||
Return a Resource handle for the specified resource.
| |||||||||||
Specify the ClassLoader to load class path resources with, or
null
for using the thread context class loader at the time of actual resource access. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return a Resource handle for the resource at the given path.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.core.io.ResourceLoader
|
Create a new DefaultResourceLoader.
ClassLoader access will happen using the thread context class loader at the time of this ResourceLoader's initialization.
Create a new DefaultResourceLoader.
classLoader | the ClassLoader to load class path resources with, or null
for using the thread context class loader at the time of actual resource access
|
---|
Return the ClassLoader to load class path resources with.
Will get passed to ClassPathResource's constructor for all ClassPathResource objects created by this resource loader.
null
)
Return a Resource handle for the specified resource.
The handle should always be a reusable resource descriptor,
allowing for multiple getInputStream()
calls.
Note that a Resource handle does not imply an existing resource;
you need to invoke exists()
to check for existence.
location | the resource location |
---|
Specify the ClassLoader to load class path resources with, or null
for using the thread context class loader at the time of actual resource access.
The default is that ClassLoader access will happen using the thread context class loader at the time of this ResourceLoader's initialization.
Return a Resource handle for the resource at the given path.
The default implementation supports class path locations. This should be appropriate for standalone implementations but can be overridden, e.g. for implementations targeted at a Servlet container.
path | the path to the resource |
---|