code: private void registerPath(Path path, int maxDepth) {
  		try {
  			final WatchKey key = path.register(watchService, ArrayUtil.isEmpty(this.events) ? EVENTS_ALL : this.events);
  			watchKeyPathMap.put(key, path);
  			if(maxDepth > 1) {
  				//遍历所有子目录并加入监听
  				Files.walkFileTree(path, EnumSet.noneOf(FileVisitOption.class), maxDepth, new SimpleFileVisitor<Path>(){
  					@Override
  					public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
  						registerPath(dir, 0);//继续添加目录
  						return super.postVisitDirectory(dir, exc);
  					}
  				});
  			}
  		} catch (IOException e) {
  			if(e instanceof AccessDeniedException) {
  				//对于禁止访问的目录，跳过监听
  				return;
  			}
  			throw new WatchException(e);
  		}
  	}
docs: 将指定路径加入到监听中
  @param path 路径
  @param maxDepth 递归下层目录的最大深度
  @return {@link WatchKey}