code: protected @Nonnull WatchKey registerPath(@Nonnull Path dir) throws IOException {
          return dir.register(watchService,
                  StandardWatchEventKinds.ENTRY_CREATE,
                  StandardWatchEventKinds.ENTRY_DELETE,
                  StandardWatchEventKinds.ENTRY_MODIFY
          );
      }
docs: Registers a patch to watch.
  
  @param dir The directory to watch
  @return The watch key
  @throws IOException if an error occurs.