类 ApplicationResourceLoader
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.boot.io.ApplicationResourceLoader
- 所有已实现的接口:
ResourceLoader
Class can be used to obtain
ResourceLoaders
supporting
additional ProtocolResolvers
registered in
spring.factories
.
When not delegating to an existing resource loader, plain paths without a qualifier
will resolve to file system resources. This is different from
DefaultResourceLoader
, which resolves unqualified paths to classpath resources.
- 从以下版本开始:
- 3.3.0
- 作者:
- Scott Frederick, Phillip Webb
-
嵌套类概要
嵌套类修饰符和类型类说明static interface
Strategy interface registered inspring.factories
and used byApplicationResourceLoader
to determine the file path of loaded resource when it can also be represented as aFileSystemResource
.从类继承的嵌套类/接口 org.springframework.core.io.DefaultResourceLoader
DefaultResourceLoader.ClassPathContextResource
-
字段概要
从接口继承的字段 org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
-
构造器概要
构造器构造器说明已过时, 待删除: 此 API 元素将从以后的版本中删除。ApplicationResourceLoader
(ClassLoader classLoader) 已过时, 待删除: 此 API 元素将从以后的版本中删除。since 3.4.0 for removal in 4.0.0 in favor ofget(ClassLoader)
-
方法概要
修饰符和类型方法说明static ResourceLoader
get()
static ResourceLoader
get
(ClassLoader classLoader) static ResourceLoader
get
(ClassLoader classLoader, SpringFactoriesLoader springFactoriesLoader) static ResourceLoader
get
(ResourceLoader resourceLoader) Return aResourceLoader
delegating to the given resource loader and supporting additionalProtocolResolvers
registered inspring.factories
.static ResourceLoader
get
(ResourceLoader resourceLoader, boolean preferFileResolution) Return aResourceLoader
delegating to the given resource loader and supporting additionalProtocolResolvers
registered inspring.factories
.static ResourceLoader
get
(ResourceLoader resourceLoader, SpringFactoriesLoader springFactoriesLoader) Return aResourceLoader
delegating to the given resource loader and supporting additionalProtocolResolvers
registered inspring.factories
.protected Resource
getResourceByPath
(String path) 从类继承的方法 org.springframework.core.io.DefaultResourceLoader
addProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceCache, setClassLoader
-
构造器详细资料
-
ApplicationResourceLoader
已过时, 待删除: 此 API 元素将从以后的版本中删除。since 3.4.0 for removal in 4.0.0 in favor ofget()
Create a newApplicationResourceLoader
. -
ApplicationResourceLoader
@Deprecated(since="3.4.0", forRemoval=true) public ApplicationResourceLoader(ClassLoader classLoader) 已过时, 待删除: 此 API 元素将从以后的版本中删除。since 3.4.0 for removal in 4.0.0 in favor ofget(ClassLoader)
Create a newApplicationResourceLoader
.- 参数:
classLoader
- theClassLoader
to load class path resources with, ornull
for using the thread context class loader at the time of actual resource access
-
-
方法详细资料
-
getResourceByPath
-
get
Return aResourceLoader
supporting additionalProtocolResolvers
registered inspring.factories
. The factories file will be resolved using the default class loader at the time this call is made. Resources will be resolved using the default class loader at the time they are resolved.- 返回:
- a
ResourceLoader
instance - 从以下版本开始:
- 3.4.0
-
get
Return aResourceLoader
supporting additionalProtocolResolvers
registered inspring.factories
. The factories files and resources will be resolved using the specified class loader.- 参数:
classLoader
- the class loader to use ornull
to use the default class loader- 返回:
- a
ResourceLoader
instance - 从以下版本开始:
- 3.4.0
-
get
public static ResourceLoader get(ClassLoader classLoader, SpringFactoriesLoader springFactoriesLoader) - 参数:
classLoader
- the class loader to use ornull
to use the default class loaderspringFactoriesLoader
- theSpringFactoriesLoader
used to loadProtocolResolvers
- 返回:
- a
ResourceLoader
instance - 从以下版本开始:
- 3.4.0
-
get
Return aResourceLoader
delegating to the given resource loader and supporting additionalProtocolResolvers
registered inspring.factories
. The factories file will be resolved using the default class loader at the time this call is made.- 参数:
resourceLoader
- the delegate resource loader- 返回:
- a
ResourceLoader
instance - 从以下版本开始:
- 3.4.0
-
get
Return aResourceLoader
delegating to the given resource loader and supporting additionalProtocolResolvers
registered inspring.factories
. The factories file will be resolved using the default class loader at the time this call is made.- 参数:
resourceLoader
- the delegate resource loaderpreferFileResolution
- if file based resolution is preferred when a suitableApplicationResourceLoader.FilePathResolver
support the resource- 返回:
- a
ResourceLoader
instance - 从以下版本开始:
- 3.4.1
-
get
public static ResourceLoader get(ResourceLoader resourceLoader, SpringFactoriesLoader springFactoriesLoader) Return aResourceLoader
delegating to the given resource loader and supporting additionalProtocolResolvers
registered inspring.factories
.- 参数:
resourceLoader
- the delegate resource loaderspringFactoriesLoader
- theSpringFactoriesLoader
used to loadProtocolResolvers
- 返回:
- a
ResourceLoader
instance - 从以下版本开始:
- 3.4.0
-
get()