Package org.springframework.boot.io
Class ApplicationResourceLoader
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.boot.io.ApplicationResourceLoader
- All Implemented Interfaces:
org.springframework.core.io.ResourceLoader
public class ApplicationResourceLoader
extends org.springframework.core.io.DefaultResourceLoader
A
DefaultResourceLoader
with any ProtocolResolvers
registered in a spring.factories
file applied to it. Plain paths without a
qualifier will resolve to file system resources. This is different from
DefaultResourceLoader
, which resolves unqualified paths to classpath resources.- Since:
- 3.3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.core.io.DefaultResourceLoader
org.springframework.core.io.DefaultResourceLoader.ClassPathContextResource
-
Field Summary
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
-
Constructor Summary
ConstructorDescriptionCreate a newApplicationResourceLoader
.ApplicationResourceLoader
(ClassLoader classLoader) Create a newApplicationResourceLoader
. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.core.io.Resource
getResourceByPath
(String path) Methods inherited from class org.springframework.core.io.DefaultResourceLoader
addProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceCache, setClassLoader
-
Constructor Details
-
ApplicationResourceLoader
public ApplicationResourceLoader()Create a newApplicationResourceLoader
. -
ApplicationResourceLoader
Create a newApplicationResourceLoader
.- Parameters:
classLoader
- theClassLoader
to load class path resources with, ornull
for using the thread context class loader at the time of actual resource access
-
-
Method Details
-
getResourceByPath
- Overrides:
getResourceByPath
in classorg.springframework.core.io.DefaultResourceLoader
-