List of usage examples for java.util.concurrent BlockingDeque size
int size();
From source file:org.fim.internal.StateGenerator.java
private void scanFileTree(BlockingDeque<Path> filesToHashQueue, Path directory, FimIgnore parentFimIgnore) throws NoSuchAlgorithmException { try (DirectoryStream<Path> stream = Files.newDirectoryStream(directory)) { FimIgnore fimIgnore = fimIgnoreManager.loadLocalIgnore(directory, parentFimIgnore); for (Path file : stream) { if (!fileHashersStarted && filesToHashQueue.size() > FILES_QUEUE_CAPACITY / 2) { startFileHashers();// w w w . j av a 2s. c om } BasicFileAttributes attributes = Files.readAttributes(file, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); String fileName = file.getFileName().toString(); if (fimIgnoreManager.isIgnored(fileName, attributes, fimIgnore)) { fimIgnoreManager.ignoreThisFiles(file, attributes); } else { if (attributes.isRegularFile()) { enqueueFile(filesToHashQueue, file); } else if (attributes.isDirectory()) { scanFileTree(filesToHashQueue, file, fimIgnore); } } } } catch (IOException ex) { Console.newLine(); Logger.error("Skipping - Error scanning directory '" + directory + "'", ex, context.isDisplayStackTrace()); } }