code: public void addPathAlterationObserver(PathAlterationListener listener,
        Optional<PathAlterationObserver> observerOptional, Path rootDirPath)
        throws IOException {
      PathAlterationObserver observer = observerOptional.or(new PathAlterationObserver(rootDirPath));
      observer.addListener(listener);
      addObserver(observer);
    }
docs: Create and attach {@link PathAlterationObserverScheduler}s for the given
  root directory and any nested subdirectories under the root directory to the given
  {@link PathAlterationObserverScheduler}.
  @param detector  a {@link PathAlterationObserverScheduler}
  @param listener a {@link org.apache.gobblin.util.filesystem.PathAlterationListener}
  @param observerOptional Optional observer object. For testing routine, this has been initialized by user.
  But for general usage, the observer object is created inside this method.
  @param rootDirPath root directory
  @throws IOException