Class ClassPathStoreResourceResolver

java.lang.Object
org.springframework.core.io.support.PathMatchingResourcePatternResolver
org.springframework.extensions.webscripts.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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • 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

    Modifier and Type
    Method
    Description
    org.springframework.core.io.Resource
    getResource(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(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

    addAllClassLoaderJarRoots, addClassPathManifestEntries, clearCache, convertClassLoaderURL, determineRootDir, doFindAllClassPathResources, doFindPathMatchingFileResources, doFindPathMatchingJarResources, findAllClassPathResources, findAllModulePathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResourceLoader, isJarResource, resolveRootDirResource, setPathMatcher, setUseCaches

    Methods inherited from class java.lang.Object

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

    • ClassPathStoreResourceResolver

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

    • getResource

      public org.springframework.core.io.Resource getResource(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(String locationPattern) throws 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:
      IOException
      See Also:
      • PathMatchingResourcePatternResolver.getResources(java.lang.String)