code: protected File getWatchDir(File changedFile) {
          for (File watchDir : watchDirs) {
              File changedFileParent = changedFile.getParentFile();
              while (changedFileParent != null) {
                  if (changedFileParent.equals(watchDir)) {
                      return watchDir;
                  } else {
                      changedFileParent = changedFileParent.getParentFile();
                  }
              }
          }
          return null;
      }
docs: /*
  Determines which of the watched directories includes the changed file.
  Returns null if the file is not included in any watch directories.