private void unscan(final Path file) throws IOException { if (isMatchesFile(file)) { Processor processor = getProcessor(); if (processor != null) { processor.onRemove(file); } lastModified = System.currentTimeMillis(); } else { // lets find all the files that now no longer exist List<Path> files = new ArrayList<Path>(processedMap.keySet()); for (Path path : files) { if (!Files.exists(path)) { LOGGER.debug("File has been deleted: " + path); processedMap.remove(path); if (isMatchesFile(path)) { Processor processor = getProcessor(); if (processor != null) { processor.onRemove(path); } fireListeners(path, ENTRY_DELETE); lastModified = System.currentTimeMillis(); } } } } }
private void unscan(final Path file) throws IOException { if (isMatchesFile(file)) { Processor processor = getProcessor(); if (processor != null) { processor.onRemove(file); } lastModified = System.currentTimeMillis(); } else { // lets find all the files that now no longer exist List<Path> files = new ArrayList<Path>(processedMap.keySet()); for (Path path : files) { if (!Files.exists(path)) { LOGGER.debug("File has been deleted: " + path); processedMap.remove(path); if (isMatchesFile(path)) { Processor processor = getProcessor(); if (processor != null) { processor.onRemove(path); } fireListeners(path, ENTRY_DELETE); lastModified = System.currentTimeMillis(); } } } } }