@SuppressWarnings("MagicNumber")
    protected Resource[] findPathMatchingResources(String locationPattern) throws IOException {
        String rootDirPath = determineRootDir(locationPattern);
        String subPattern = locationPattern.substring(rootDirPath.length());
        Resource[] rootDirResources = getResources(rootDirPath);
        Set<Resource> result = new LinkedHashSet<Resource>(16);
        for (Resource rootDirResource : rootDirResources) {
            rootDirResource = resolveRootDirResource(rootDirResource);
            if (isJarResource(rootDirResource)) {
                result.addAll(doFindPathMatchingJarResources(rootDirResource, subPattern));
            } else {
                result.addAll(doFindPathMatchingFileResources(rootDirResource, subPattern));
            }
        }
        return result.toArray(new Resource[0]);
    }
@ SuppressWarnings ( "MagicNumber" ) protected Resource [ ] findPathMatchingResources ( String locationPattern ) throws IOException { String rootDirPath = determineRootDir ( locationPattern ) ; String subPattern = locationPattern . substring ( rootDirPath . length ( ) ) ; Resource [ ] rootDirResources = getResources ( rootDirPath ) ; Set < Resource > result = new LinkedHashSet < Resource > ( 16 ) ; for ( Resource rootDirResource : rootDirResources ) { rootDirResource = resolveRootDirResource ( rootDirResource ) ; if ( isJarResource ( rootDirResource ) ) { result . addAll ( doFindPathMatchingJarResources ( rootDirResource , subPattern ) ) ; } else { result . addAll ( doFindPathMatchingFileResources ( rootDirResource , subPattern ) ) ; } } return result . toArray ( new Resource [ 0 ] ) ; }
Find all resources that match the given location pattern via the
Ant-style PathMatcher. Supports resources in jar files and zip files
and in the file system.

@param locationPattern the location pattern to match
@return the result as Resource array
@throws IOException in case of I/O errors
@see #doFindPathMatchingJarResources
@see #doFindPathMatchingFileResources