Class 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

      Constructors 
      Constructor Description
      ResourceFinder()  
      ResourceFinder​(org.springframework.core.io.ResourceLoader resourceLoader)
      The Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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

        addAllClassLoaderJarRoots, addClassPathManifestEntries, convertClassLoaderURL, determineRootDir, doFindAllClassPathResources, doFindMatchingFileSystemResources, doFindPathMatchingJarResources, doRetrieveMatchingFiles, findAllClassPathResources, findPathMatchingResources, getClassLoader, getJarFile, getPathMatcher, getResource, getResourceLoader, getResources, isJarResource, listDirectory, 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.