类 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, Moritz Halbritter, Phillip Webb
-
嵌套类概要
嵌套类修饰符和类型类说明static interfaceStrategy interface registered inspring.factoriesand used byApplicationResourceLoaderto 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 ResourceLoaderget()static ResourceLoaderget(ClassLoader classLoader) static ResourceLoaderget(ClassLoader classLoader, SpringFactoriesLoader springFactoriesLoader) static ResourceLoaderget(ClassLoader classLoader, SpringFactoriesLoader springFactoriesLoader, Path workingDirectory) static ResourceLoaderget(ResourceLoader resourceLoader) Return aResourceLoaderdelegating to the given resource loader and supporting additionalProtocolResolversregistered inspring.factories.static ResourceLoaderget(ResourceLoader resourceLoader, boolean preferFileResolution) Return aResourceLoaderdelegating to the given resource loader and supporting additionalProtocolResolversregistered inspring.factories.static ResourceLoaderget(ResourceLoader resourceLoader, SpringFactoriesLoader springFactoriesLoader) Return aResourceLoaderdelegating to the given resource loader and supporting additionalProtocolResolversregistered inspring.factories.protected ResourcegetResourceByPath(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- theClassLoaderto load class path resources with, ornullfor using the thread context class loader at the time of actual resource access
-
-
方法详细资料
-
getResourceByPath
-
get
Return aResourceLoadersupporting additionalProtocolResolversregistered 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
ResourceLoaderinstance - 从以下版本开始:
- 3.4.0
-
get
Return aResourceLoadersupporting additionalProtocolResolversregistered inspring.factories. The factories files and resources will be resolved using the specified class loader.- 参数:
classLoader- the class loader to use ornullto use the default class loader- 返回:
- a
ResourceLoaderinstance - 从以下版本开始:
- 3.4.0
-
get
public static ResourceLoader get(ClassLoader classLoader, SpringFactoriesLoader springFactoriesLoader) - 参数:
classLoader- the class loader to use ornullto use the default class loaderspringFactoriesLoader- theSpringFactoriesLoaderused to loadProtocolResolvers- 返回:
- a
ResourceLoaderinstance - 从以下版本开始:
- 3.4.0
-
get
public static ResourceLoader get(ClassLoader classLoader, SpringFactoriesLoader springFactoriesLoader, Path workingDirectory) - 参数:
classLoader- the class loader to use ornullto use the default class loaderspringFactoriesLoader- theSpringFactoriesLoaderused to loadProtocolResolversworkingDirectory- the working directory- 返回:
- a
ResourceLoaderinstance - 从以下版本开始:
- 3.5.0
-
get
Return aResourceLoaderdelegating to the given resource loader and supporting additionalProtocolResolversregistered 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
ResourceLoaderinstance - 从以下版本开始:
- 3.4.0
-
get
Return aResourceLoaderdelegating to the given resource loader and supporting additionalProtocolResolversregistered 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.FilePathResolversupport the resource- 返回:
- a
ResourceLoaderinstance - 从以下版本开始:
- 3.4.1
-
get
public static ResourceLoader get(ResourceLoader resourceLoader, SpringFactoriesLoader springFactoriesLoader) Return aResourceLoaderdelegating to the given resource loader and supporting additionalProtocolResolversregistered inspring.factories.- 参数:
resourceLoader- the delegate resource loaderspringFactoriesLoader- theSpringFactoriesLoaderused to loadProtocolResolvers- 返回:
- a
ResourceLoaderinstance - 从以下版本开始:
- 3.4.0
-
get()