code: private void register(Path path, final WatchService watcher) throws IOException {
      path = path.toAbsolutePath();
  
      keys.add(path.register(
          watcher,
          new WatchEvent.Kind<?>[]{
              StandardWatchEventKinds.ENTRY_CREATE,
              StandardWatchEventKinds.ENTRY_DELETE,
              StandardWatchEventKinds.ENTRY_MODIFY
          },
          new WatchEvent.Modifier[]{SensitivityWatchEventModifier.HIGH}
      ));
    }
docs: /* WatchService