code: private void registerDirectoryTree(Path path) {
          try {
              Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
                  @Override
                  public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
                          throws IOException {
                      registerDirectory(dir);
                      return FileVisitResult.CONTINUE;
                  }
              });
          } catch (IOException ex) {
              LOGGER.error("监控目录失败：" + path.toAbsolutePath(), ex);
          }
      }
docs: 为指定目录及其所有子目录注册监控事件
  @param path 目录