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.PathMatchingResourcePatternResolverClass 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 classClassPathStoreResourceResolver.UrlInputStreamResource
-
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.ResourcegetResource(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
-
-
-
-
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:
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(java.lang.String locationPattern) throws java.io.IOExceptionLooks 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:
java.io.IOException- See Also:
PathMatchingResourcePatternResolver.getResources(java.lang.String)
-
-