code: public void watchDirectoryTree(Path dir) {
      if (_watchedDirectories == null) {
        throw new IllegalStateException("DirectoryWatcher.close() was called. Please make a new instance.");
      }
      try {
        if (Files.exists(dir)) {
          Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
            @Override
            public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
              watchDirectory(dir);
              return FileVisitResult.CONTINUE;
            }
          });
        }
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
docs: Walk the directories under given path, and register a watcher for every directory.
  
  @param dir the starting point under which to listen for changes, if it doesn't exist, do nothing.