for (File file : files) { if (file.canRead()) { String resourcePath = toResourceNameOnClasspath(classPathRootOnDisk, file); if (file.isDirectory()) { if (!ignorePath(resourcePath)) { resourceNames.addAll(findResourceNamesFromFileSystem(classPathRootOnDisk, scanRootLocation, file));
public Set<String> findResourceNames(String location, URL locationUrl) throws IOException { String filePath = UrlUtils.toFilePath(locationUrl); File folder = new File(filePath); if (!folder.isDirectory()) { LOG.debug("Skipping path as it is not a directory: " + filePath); return new TreeSet<String>(); } String classPathRootOnDisk = filePath.substring(0, filePath.length() - location.length()); if (!classPathRootOnDisk.endsWith(File.separator)) { classPathRootOnDisk = classPathRootOnDisk + File.separator; } LOG.debug("Scanning starting at classpath root in filesystem: " + classPathRootOnDisk); return findResourceNamesFromFileSystem(classPathRootOnDisk, location, folder); }
FileSystemClassPathLocationScanner locationScanner = new FileSystemClassPathLocationScanner(); locationScannerCache.put(protocol, locationScanner); resourceNameCache.put(locationScanner, new HashMap<URL, Set<String>>());