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 ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIXFields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionClassPathStoreResourceResolver(org.springframework.context.ApplicationContext applicationContext) Constructor -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.core.io.ResourcegetResource(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
-
Constructor Details
-
ClassPathStoreResourceResolver
public ClassPathStoreResourceResolver(org.springframework.context.ApplicationContext applicationContext) Constructor- Parameters:
applicationContext- ApplicationContext
-
-
Method Details
-
getResource
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:
getResourcein interfaceorg.springframework.core.io.ResourceLoader- Overrides:
getResourcein classorg.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:
getResourcesin interfaceorg.springframework.core.io.support.ResourcePatternResolver- Overrides:
getResourcesin classorg.springframework.core.io.support.PathMatchingResourcePatternResolver- Throws:
IOException- See Also:
-
PathMatchingResourcePatternResolver.getResources(java.lang.String)
-