public class DefaultResourceLoader extends java.lang.Object implements ResourceLoader
Title: DefaultResourceLoader.java
Description:
bboss workgroup
Copyright (c) 2007
CLASSPATH_URL_PREFIX| 构造器和说明 |
|---|
DefaultResourceLoader()
Create a new DefaultResourceLoader.
|
DefaultResourceLoader(java.lang.ClassLoader classLoader)
Create a new DefaultResourceLoader.
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.ClassLoader |
getClassLoader()
Return the ClassLoader to load class path resources with,
or
null if using the thread context class loader on actual access
(applying to the thread that constructs the ClassPathResource object). |
org.frameworkset.util.io.Resource |
getResource(java.lang.String location)
Return a Resource handle for the specified resource.
|
protected org.frameworkset.util.io.Resource |
getResourceByPath(java.lang.String path)
Return a Resource handle for the resource at the given path.
|
void |
setClassLoader(java.lang.ClassLoader classLoader)
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. |
public DefaultResourceLoader()
ClassLoader access will happen using the thread context class loader at the time of this ResourceLoader's initialization.
Thread.getContextClassLoader()public DefaultResourceLoader(java.lang.ClassLoader classLoader)
classLoader - the ClassLoader to load class path resources with, or null
for using the thread context class loader at the time of actual resource accesspublic void setClassLoader(java.lang.ClassLoader classLoader)
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.
public java.lang.ClassLoader getClassLoader()
null if using the thread context class loader on actual access
(applying to the thread that constructs the ClassPathResource object).
Will get passed to ClassPathResource's constructor for all ClassPathResource objects created by this resource loader.
getClassLoader 在接口中 ResourceLoadernull)ClassPathResourcepublic org.frameworkset.util.io.Resource getResource(java.lang.String location)
ResourceLoaderInputStreamSource.getInputStream() calls.
Note that a Resource handle does not imply an existing resource;
you need to invoke Resource.exists() to check for existence.
getResource 在接口中 ResourceLoaderlocation - the resource locationResourceLoader.CLASSPATH_URL_PREFIX,
Resource.exists(),
InputStreamSource.getInputStream()protected org.frameworkset.util.io.Resource getResourceByPath(java.lang.String 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 resourceClassPathResource