/** * Finds the resources names present at this location and below on the classpath starting with this prefix and * ending with this suffix. */ private Set<String> findResourceNames(Location location, ResourceFilter predicate) throws IOException { Set<String> resourceNames = new TreeSet<String>(); List<URL> locationsUrls = getLocationUrlsForPath(location); for (URL locationUrl : locationsUrls) { LOG.debug("scanning URL: {}", locationUrl.toExternalForm()); UrlResolver urlResolver = createUrlResolver(locationUrl.getProtocol()); URL resolvedUrl = urlResolver.toStandardJavaUrl(locationUrl); String protocol = resolvedUrl.getProtocol(); ClassPathLocationScanner classPathLocationScanner = createLocationScanner(protocol); if (classPathLocationScanner == null) { String scanRoot = UrlUtils.toFilePath(resolvedUrl); LOG.warn("Unable to scan location: {} (unsupported protocol: {})", scanRoot, protocol); } else { Set<String> names = resourceNameCache.get(classPathLocationScanner).get(resolvedUrl); if (names == null) { names = classPathLocationScanner.findResourceNames(location.getPath(), resolvedUrl); resourceNameCache.get(classPathLocationScanner).put(resolvedUrl, names); } resourceNames.addAll(names); } } return filterResourceNames(resourceNames, predicate); }