code: public WatchKey register(final Path pDirectory) throws IOException {
          try {
              final WatchKey key = pDirectory.register(watchService, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);
              LOG.debug("Added Directory {}", pDirectory);
              return key;
          } catch (final ClosedWatchServiceException e) {
              throw new IOException(format("Closed WatchService! Registration failed for %s", pDirectory), e);
          }
      }
docs: Registers the path specified with the {@link java.nio.file.WatchService} held by this object.
  If the path specified is not a directory, an {@link java.io.UncheckedIOException} will be caused to be thrown.
  
  @param pDirectory Directory to be watched, must not be {@code null}
  @return A key representing the registration of this object with the watch service
  @throws IOException Thrown, if the registration of the directory specified with the watch service failed.