code: public void onEvent(final WatchEvent<Path> event) {
          Kind kind = event.kind();
          if (StandardWatchEventKind.ENTRY_CREATE.equals(kind)) {
              File file = new File(event.context().toString());
              listener.fileCreated(file);
          } else if (StandardWatchEventKind.ENTRY_DELETE.equals(kind)) {
              File file = new File(event.context().toString());
              listener.fileDeleted(file);
          } else if (StandardWatchEventKind.ENTRY_MODIFY.equals(kind)) {
              File file = new File(event.context().toString());
              listener.fileChanged(file);
          }
      }
docs: Forwards watch events to the listener.
  @param event the event to forward
  @see StandardWatchEventKind
  @see DirectoryListener#fileCreated(File)
  @see DirectoryListener#fileDeleted(File)
  @see DirectoryListener#fileChanged(File)