code: private void registerAll(Path start, final ResourceMonitorImpl monitorImpl) throws IOException
     {
        // register directory and sub-directories
        Files.walkFileTree(start, new SimpleFileVisitor<Path>()
        {
           @Override
           public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
                    throws IOException
           {
              register(dir, monitorImpl);
              return FileVisitResult.CONTINUE;
           }
        });
     }
docs: Register the given directory, and all its sub-directories, with the WatchService.