Search in sources :

Example 6 with Resource

use of org.hotswap.agent.util.spring.io.resource.Resource 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

LinkedHashSet (java.util.LinkedHashSet)6 Resource (org.hotswap.agent.util.spring.io.resource.Resource)6 FileSystemResource (org.hotswap.agent.util.spring.io.resource.FileSystemResource)4 UrlResource (org.hotswap.agent.util.spring.io.resource.UrlResource)4 VfsResource (org.hotswap.agent.util.spring.io.resource.VfsResource)4 URL (java.net.URL)3 IOException (java.io.IOException)2 JarFile (java.util.jar.JarFile)2 PathMatchingResourcePatternResolver (org.hotswap.agent.util.spring.path.PathMatchingResourcePatternResolver)2 File (java.io.File)1 JarURLConnection (java.net.JarURLConnection)1 URLClassLoader (java.net.URLClassLoader)1 URLConnection (java.net.URLConnection)1 JarEntry (java.util.jar.JarEntry)1 ZipException (java.util.zip.ZipException)1