Package org.alfresco.util
Class BaseApplicationContextHelper.ResourceFinder
java.lang.Object
org.springframework.core.io.support.PathMatchingResourcePatternResolver
org.springframework.web.context.support.ServletContextResourcePatternResolver
org.alfresco.util.BaseApplicationContextHelper.ResourceFinder
- All Implemented Interfaces:
org.springframework.core.io.ResourceLoader
,org.springframework.core.io.support.ResourcePatternResolver
- Enclosing class:
- BaseApplicationContextHelper
public static class BaseApplicationContextHelper.ResourceFinder
extends org.springframework.web.context.support.ServletContextResourcePatternResolver
Can be used in Spring configuration to search for all resources matching an array of patterns.
- Author:
- dward
-
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
ConstructorsConstructorDescriptionResourceFinder
(org.springframework.core.io.ResourceLoader resourceLoader) The Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.core.io.Resource[]
getResources
(String... locationPatterns) Gets an array of resources matching the given location patterns.Methods inherited from class org.springframework.web.context.support.ServletContextResourcePatternResolver
doFindPathMatchingFileResources, doRetrieveMatchingServletContextResources
Methods inherited from class org.springframework.core.io.support.PathMatchingResourcePatternResolver
addAllClassLoaderJarRoots, addClassPathManifestEntries, convertClassLoaderURL, determineRootDir, doFindAllClassPathResources, doFindMatchingFileSystemResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResource, getResourceLoader, getResources, isJarResource, listDirectory, resolveRootDirResource, retrieveMatchingFiles, setPathMatcher
-
Constructor Details
-
ResourceFinder
public ResourceFinder() -
ResourceFinder
public ResourceFinder(org.springframework.core.io.ResourceLoader resourceLoader) The Constructor.- Parameters:
resourceLoader
- the resource loader
-
-
Method Details
-
getResources
public org.springframework.core.io.Resource[] getResources(String... locationPatterns) throws IOException Gets an array of resources matching the given location patterns.- Parameters:
locationPatterns
- the location patterns- Returns:
- the matching resources, ordered by locationPattern index and location in the classpath
- Throws:
IOException
- Signals that an I/O exception has occurred.
-