Class FileWatcher

java.lang.Object
org.mockserver.persistence.FileWatcher

public class FileWatcher extends Object
  • Constructor Details

    • FileWatcher

      public FileWatcher(Path filePath, Runnable updatedHandler, Consumer<Throwable> errorHandler, MockServerLogger mockServerLogger, long pollPeriodMillis)
      Parameters:
      pollPeriodMillis - the interval, in milliseconds, between successive polls of the watched file. Captured here when scheduleAtFixedRate is set up, so the first poll lands one full period after construction. The poll period is supplied per-watcher (via the watchInitializationJsonPollPeriodMillis configuration property, see Configuration) rather than held in shared mutable static state, so concurrent watchers / tests can use different periods without racing each other. A non-positive value is clamped up to 1ms to satisfy scheduleAtFixedRate.
  • Method Details