Пример #1
0
  public void ensureStarted() {
    if (watcher != null) {
      return;
    }

    if (!folder.toFile().exists()) {
      return;
    }

    if (isMac()) {
      watcher = new OsxWatchService(folder);
    } else {
      watcher = new JdkWatchService(folder);
    }
    watcher.onChange(listener);
  }
Пример #2
0
 public void stop() {
   if (watcher != null) {
     watcher.stop();
   }
 }