code: private void addSubDirectory(Path root, Path filePath) throws IOException {
          String listener = getListenerRootPath(root);
  
          List<String> listeners = mSubDirectories.get(listener);
  
          if (listeners != null) {
              if (mSubDirectories.get(listener).contains(filePath.toAbsolutePath())) {
                  return;
              } else {
                  mSubDirectories.get(listener).add(filePath.toString());
              }
  
              try {
                  watchDir(filePath.toFile());
              } catch (IOException e) {
                  throw new IOException("Could not watch the subdirectories.", e);
              }
          }
      }
docs: In this method a subdirectory is being added to the system and watched.
  
  This is necessary since the {@link WatchService} doesn't support watching
  a folder with higher depths than 1.
  
  @param root
  @param filePath
  @throws IOException