Class ClassPathStoreResourceResolver

  • All Implemented Interfaces:
    org.springframework.core.io.ResourceLoader, org.springframework.core.io.support.ResourcePatternResolver

    public class ClassPathStoreResourceResolver
    extends org.springframework.core.io.support.PathMatchingResourcePatternResolver
    Class path resource resolver that traverses the entire class path. This includes both class files as well as the contents of JAR files.
    Author:
    muzquiano
    • Field Summary

      • Fields inherited from interface org.springframework.core.io.ResourceLoader

        CLASSPATH_URL_PREFIX
      • Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver

        CLASSPATH_ALL_URL_PREFIX
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassPathStoreResourceResolver​(org.springframework.context.ApplicationContext applicationContext)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.core.io.Resource getResource​(java.lang.String location)
      Retrieves a resource for a given location This method performs a robust lookup, first checking the servlet context for the resource.
      org.springframework.core.io.Resource[] getResources​(java.lang.String locationPattern)
      Looks up resources by matching against a given location pattern Performs a robust match of the given location pattern against both servlet context class path resources as well as resources contained within JAR files.
      • Methods inherited from class org.springframework.core.io.support.PathMatchingResourcePatternResolver

        convertClassLoaderURL, determineRootDir, doFindMatchingFileSystemResources, doFindPathMatchingFileResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResourceLoader, isJarResource, resolveRootDirResource, retrieveMatchingFiles, setPathMatcher
      • Methods inherited from class java.lang.Object

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

      • ClassPathStoreResourceResolver

        public ClassPathStoreResourceResolver​(org.springframework.context.ApplicationContext applicationContext)
        Constructor
        Parameters:
        applicationContext - ApplicationContext
    • Method Detail

      • getResource

        public org.springframework.core.io.Resource getResource​(java.lang.String location)
        Retrieves a resource for a given location This method performs a robust lookup, first checking the servlet context for the resource. This will resolve simple class files and other simple class path elements. These are physical file elements accessible by the resource loader. If nothing is found, the JAR files in the servlet context are then consulted. This lookup may result in a URL to an element inside of a JAR file. If a resource cannot ultimately be found, null is returned.
        Specified by:
        getResource in interface org.springframework.core.io.ResourceLoader
        Overrides:
        getResource in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
        See Also:
        PathMatchingResourcePatternResolver.getResource(java.lang.String)
      • getResources

        public org.springframework.core.io.Resource[] getResources​(java.lang.String locationPattern)
                                                            throws java.io.IOException
        Looks up resources by matching against a given location pattern Performs a robust match of the given location pattern against both servlet context class path resources as well as resources contained within JAR files. The incoming location pattern is expected to be prefixed with classpath*:
        Specified by:
        getResources in interface org.springframework.core.io.support.ResourcePatternResolver
        Overrides:
        getResources in class org.springframework.core.io.support.PathMatchingResourcePatternResolver
        Throws:
        java.io.IOException
        See Also:
        PathMatchingResourcePatternResolver.getResources(java.lang.String)