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

    Constructors
    Constructor
    Description
    Create a new ApplicationResourceLoader.
    Create a new ApplicationResourceLoader.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.core.io.Resource
     

    Methods inherited from class org.springframework.core.io.DefaultResourceLoader

    addProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceCache, setClassLoader

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ApplicationResourceLoader

      public ApplicationResourceLoader()
      Create a new ApplicationResourceLoader.
    • ApplicationResourceLoader

      public ApplicationResourceLoader(ClassLoader classLoader)
      Create a new ApplicationResourceLoader.
      Parameters:
      classLoader - the ClassLoader to load class path resources with, or null for using the thread context class loader at the time of actual resource access
  • Method Details

    • getResourceByPath

      protected org.springframework.core.io.Resource getResourceByPath(String path)
      Overrides:
      getResourceByPath in class org.springframework.core.io.DefaultResourceLoader