@Test public void testDirectoryScanner() { final AntPatternFileFilter fileFilter = new AntPatternFileFilter( true, true, Collections.<String>singleton("**"), Collections.<String>emptySet()); final Map<File, Resource> results = directoryScanner.scanDirectoryWithResults( testDirectory, fileFilter, Functions.<Resource>identity()); assertEquals(7, results.size()); }
@Override public <T> Map<File, T> scanDirectoryWithResults( File directory, FileFilter fileFilter, Function<Resource, T> fileProcessor) { final ConcurrentMap<File, T> results = new ConcurrentHashMap<File, T>(); this.scanDirectory(directory, results, fileFilter, fileProcessor); return results; }
ConcurrentDirectoryScanner implements DirectoryScanner { @Override public <T> Map<File, T> scanDirectoryWithResults( File directory, FileFilter fileFilter, Function<Resource, T> fileProcessor) { final ConcurrentMap<File, T> results = new ConcurrentHashMap<File, T>(); this.scanDirectory(directory, results, fileFilter, fileProcessor); return results; } }
ConcurrentDirectoryScanner implements DirectoryScanner { @Override public <T> Map<File, T> scanDirectoryWithResults( File directory, FileFilter fileFilter, Function<Resource, T> fileProcessor) { final ConcurrentMap<File, T> results = new ConcurrentHashMap<File, T>(); this.scanDirectory(directory, results, fileFilter, fileProcessor); return results; } ConcurrentDirectoryScanner(ExecutorService executorService); }
ConcurrentDirectoryScanner implements DirectoryScanner { @Override public <T> Map<File, T> scanDirectoryWithResults( File directory, FileFilter fileFilter, Function<Resource, T> fileProcessor) { final ConcurrentMap<File, T> results = new ConcurrentHashMap<File, T>(); this.scanDirectory(directory, results, fileFilter, fileProcessor); return results; } ConcurrentDirectoryScanner(ExecutorService executorService); void setProcessDirectories(boolean processDirectories); void setRecursive(boolean recursive); void setMaxWait(long maxWait); void setMaxWaitTimeUnit(TimeUnit maxWaitTimeUnit); @Override Map<File, T> scanDirectoryWithResults(
            File directory, FileFilter fileFilter, Function<Resource, T> fileProcessor); @Override void scanDirectoryNoResults(
            File directory, FileFilter fileFilter, Function<Resource, ?> fileProcessor); }
ConcurrentDirectoryScanner implements DirectoryScanner { @Override public <T> Map<File, T> scanDirectoryWithResults( File directory, FileFilter fileFilter, Function<Resource, T> fileProcessor) { final ConcurrentMap<File, T> results = new ConcurrentHashMap<File, T>(); this.scanDirectory(directory, results, fileFilter, fileProcessor); return results; } ConcurrentDirectoryScanner(ExecutorService executorService); void setProcessDirectories(boolean processDirectories); void setRecursive(boolean recursive); void setMaxWait(long maxWait); void setMaxWaitTimeUnit(TimeUnit maxWaitTimeUnit); @Override Map<File, T> scanDirectoryWithResults(
            File directory, FileFilter fileFilter, Function<Resource, T> fileProcessor); @Override void scanDirectoryNoResults(
            File directory, FileFilter fileFilter, Function<Resource, ?> fileProcessor);  }