All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.swoval.files.PlatformWatcher Maven / Gradle / Ivy

There is a newer version: 2.1.12
Show newest version
package com.swoval.files;

import com.swoval.files.PathWatchers.Event;
import com.swoval.logging.Logger;
import java.io.IOException;

class PlatformWatcher {
  static PathWatcher make(
      final boolean followLinks, final DirectoryRegistry directoryRegistry, final Logger logger)
      throws InterruptedException, IOException {
    return make(followLinks, RegisterableWatchServices.get(), directoryRegistry, logger);
  }

  static PathWatcher make(
      final boolean followLinks,
      final RegisterableWatchService registerableWatchService,
      final DirectoryRegistry directoryRegistry,
      final Logger logger)
      throws InterruptedException, IOException {
    final PathWatcher pathWatcher =
        new NioPathWatcher(directoryRegistry, registerableWatchService, logger);
    return followLinks
        ? new SymlinkFollowingPathWatcher(pathWatcher, directoryRegistry, logger)
        : pathWatcher;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy