public class ClassPathResourceLoader extends java.lang.Object implements ResourceLoader
Title: DefaultResourceLoader.java
Description:
bboss workgroup
Copyright (c) 2007
CLASSPATH_URL_PREFIX| 构造器和说明 |
|---|
ClassPathResourceLoader()
Create a new DefaultResourceLoader.
|
ClassPathResourceLoader(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.
|
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 ClassPathResourceLoader()
ClassLoader access will happen using the thread context class loader at the time of this ResourceLoader's initialization.
Thread.getContextClassLoader()public ClassPathResourceLoader(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()