Search in sources :

Example 1 with FileSystemResource

use of org.hotswap.agent.util.spring.io.resource.FileSystemResource in project HotswapAgent by HotswapProjects.

the class PathMatchingResourcePatternResolver method doFindMatchingFileSystemResources.

/**
 * Find all resources in the file system that match the given location
 * pattern via the Ant-style PathMatcher.
 *
 * @param rootDir
 *            the root directory in the file system
 * @param subPattern
 *            the sub pattern to match (below the root directory)
 * @return a mutable Set of matching Resource instances
 * @throws IOException
 *             in case of I/O errors
 * @see #retrieveMatchingFiles
 * @see org.hotswap.agent.util.spring.path.springframework.util.PathMatcher
 */
protected Set<Resource> doFindMatchingFileSystemResources(File rootDir, String subPattern) throws IOException {
    if (logger.isDebugEnabled()) {
        logger.debug("Looking for matching resources in directory tree [" + rootDir.getPath() + "]");
    }
    Set<File> matchingFiles = retrieveMatchingFiles(rootDir, subPattern);
    Set<Resource> result = new LinkedHashSet<Resource>(matchingFiles.size());
    for (File file : matchingFiles) {
        result.add(new FileSystemResource(file));
    }
    return result;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) VfsResource(org.hotswap.agent.util.spring.io.resource.VfsResource) FileSystemResource(org.hotswap.agent.util.spring.io.resource.FileSystemResource) UrlResource(org.hotswap.agent.util.spring.io.resource.UrlResource) Resource(org.hotswap.agent.util.spring.io.resource.Resource) FileSystemResource(org.hotswap.agent.util.spring.io.resource.FileSystemResource) JarFile(java.util.jar.JarFile) File(java.io.File)

Aggregations

File (java.io.File)1 LinkedHashSet (java.util.LinkedHashSet)1 JarFile (java.util.jar.JarFile)1 FileSystemResource (org.hotswap.agent.util.spring.io.resource.FileSystemResource)1 Resource (org.hotswap.agent.util.spring.io.resource.Resource)1 UrlResource (org.hotswap.agent.util.spring.io.resource.UrlResource)1 VfsResource (org.hotswap.agent.util.spring.io.resource.VfsResource)1