/** * 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 */ public void addPathAlterationObserver(PathAlterationListener listener, Optional<PathAlterationObserver> observerOptional, Path rootDirPath) throws IOException { PathAlterationObserver observer = observerOptional.or(new PathAlterationObserver(rootDirPath)); observer.addListener(listener); addObserver(observer); }
/** * Add {@link PathAlterationObserverScheduler}s for the given * root directory and any nested subdirectories under the root directory to the given * {@link PathAlterationObserverScheduler}. * * @param monitor a {@link PathAlterationObserverScheduler} * @param listener a {@link org.apache.gobblin.util.filesystem.PathAlterationListener} * @param rootDirPath root directory */ public static void addPathAlterationObserver(PathAlterationObserverScheduler monitor, PathAlterationListener listener, Path rootDirPath) throws IOException { PathAlterationObserver observer = new PathAlterationObserver(rootDirPath); observer.addListener(listener); monitor.addObserver(observer); }
/** * 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 */ public void addPathAlterationObserver(PathAlterationListener listener, Optional<PathAlterationObserver> observerOptional, Path rootDirPath) throws IOException { PathAlterationObserver observer = observerOptional.or(new PathAlterationObserver(rootDirPath)); observer.addListener(listener); addObserver(observer); }
/** * Add {@link PathAlterationObserverScheduler}s for the given * root directory and any nested subdirectories under the root directory to the given * {@link PathAlterationObserverScheduler}. * * @param monitor a {@link PathAlterationObserverScheduler} * @param listener a {@link org.apache.gobblin.util.filesystem.PathAlterationListener} * @param rootDirPath root directory */ public static void addPathAlterationObserver(PathAlterationObserverScheduler monitor, PathAlterationListener listener, Path rootDirPath) throws IOException { PathAlterationObserver observer = new PathAlterationObserver(rootDirPath); observer.addListener(listener); monitor.addObserver(observer); }