Scanner extends ExecutorProxy { public Future<Long> scan(final Path path) { return executor.submit(createScannerVisitor(path)); } Scanner(final BlockingQueue<Path> queue);  Scanner(final BlockingQueue<Path> queue, final SealableLatch latch);  Scanner(final BlockingQueue<Path> queue, final SealableLatch latch, final
	Notifiable notifiable); Scanner configure(final Options<String> options); void include(final String pattern); void exclude(final String pattern); void followSymLinks(final boolean followLinks); boolean followSymLinks(); void ignoreHiddenFiles(final boolean ignoreHiddenFiles); boolean ignoreHiddenFiles(); void ignoreSystemFiles(final boolean ignoreSystemFiles); boolean ignoreSystemFiles(); void setMaxDepth(final int maxDepth); int getMaxDepth(); SealableLatch getLatch(); long queued(); Future<Long> scan(final Path path); ScannerVisitor createScannerVisitor(Path path); List<Future<Long>> scan(final Path[] paths); List<Future<Long>> scan(final String[] paths); long getNumberOfFiles(final Path path);  }
@Test public void testScanDirectory() throws Throwable { final Path root = Paths.get(getClass().getResource("/documents/text/").toURI()); final Future<Long> job = scanner.scan(root); assertEquals(3L, (long)job.get()); shutdownScanner(scanner); Assert.assertTrue(Files.exists(root.resolve("plain.txt"))); Assert.assertTrue(String.format("Queued file path must start with root path \"%s\".", root), queue.contains(root.resolve("plain.txt"))); try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(root)) { for (Path file : directoryStream) { Assert.assertTrue(String.format("Failed asserting that queue contains \"%s\".", file), queue.contains(file)); } } }