/** * Creates a recursive watcher for the given root path. The returned watcher * will ignore the ignore paths and fire an event through the {@link WatchListener} * as soon as the settle delay (in ms) has passed. * * <p>The method returns a platform-specific recursive watcher: {@link WindowsRecursiveWatcher} * for Windows and {@link DefaultRecursiveWatcher} for other operating systems. */ public static RecursiveWatcher createRecursiveWatcher(Path root, List<Path> ignorePaths, int settleDelay, WatchListener listener) { if (EnvironmentUtil.isWindows()) { return new WindowsRecursiveWatcher(root, ignorePaths, settleDelay, listener); } else { return new DefaultRecursiveWatcher(root, ignorePaths, settleDelay, listener); } }