@Test public void testMultiFileUpdate() throws InterruptedException, IOException { long fileChanges = poller.getStats().getFileChangesDetected(); Files.write(file1.toPath(), new byte[]{11}, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING); Files.write(file2.toPath(), new byte[]{22}, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING); while (poller.getStats().getFileChangesDetected() < fileChanges + 2) { Thread.sleep(25); } Assert.assertEquals(poller.getUpdatedFilesSinceLastTime(), ImmutableSet.of(file1, file2)); }
public Stats getStats() { return new Stats(stats); }
PollingMultiFileWatcher implements MultiFileWatcher { public Stats getStats() { return new Stats(stats); } }
PollingMultiFileWatcher implements MultiFileWatcher { public Stats getStats() { return new Stats(stats); } PollingMultiFileWatcher(Duration initialDelay, Duration interval); }
PollingMultiFileWatcher implements MultiFileWatcher { public Stats getStats() { return new Stats(stats); } PollingMultiFileWatcher(Duration initialDelay, Duration interval); @Override void start(Set<File> files, Consumer<Set<File>> callback); @Override boolean isStarted(); @Override void shutdown(); Stats getStats(); }
PollingMultiFileWatcher implements MultiFileWatcher { public Stats getStats() { return new Stats(stats); } PollingMultiFileWatcher(Duration initialDelay, Duration interval); @Override void start(Set<File> files, Consumer<Set<File>> callback); @Override boolean isStarted(); @Override void shutdown(); Stats getStats();  }