org.alfresco.util
Class ResourceFinder

java.lang.Object
  extended by org.springframework.core.io.support.PathMatchingResourcePatternResolver
      extended by org.springframework.web.context.support.ServletContextResourcePatternResolver
          extended by org.alfresco.util.ResourceFinder
All Implemented Interfaces:
org.springframework.core.io.ResourceLoader, org.springframework.core.io.support.ResourcePatternResolver

public class ResourceFinder
extends org.springframework.web.context.support.ServletContextResourcePatternResolver

Can be used in Spring configuration to search for all resources matching an array of patterns.


Field Summary
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
 
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
 
Constructor Summary
ResourceFinder()
           
ResourceFinder(org.springframework.core.io.ResourceLoader resourceLoader)
          The Constructor.
 
Method Summary
 org.springframework.core.io.Resource[] getResources(java.lang.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
convertClassLoaderURL, determineRootDir, doFindMatchingFileSystemResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResource, getResourceLoader, getResources, isJarResource, resolveRootDirResource, retrieveMatchingFiles, setPathMatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceFinder

public ResourceFinder()

ResourceFinder

public ResourceFinder(org.springframework.core.io.ResourceLoader resourceLoader)
The Constructor.

Parameters:
resourceLoader - the resource loader
Method Detail

getResources

public org.springframework.core.io.Resource[] getResources(java.lang.String[] locationPatterns)
                                                    throws java.io.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:
java.io.IOException - Signals that an I/O exception has occurred.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.