Interface DirectoryWatchService

All Superinterfaces:
Service
All Known Implementing Classes:
SimpleDirectoryWatchService

public interface DirectoryWatchService extends Service
Interface definition of a simple directory watch service. Implementations of this interface allow interested parties to listen to file system events coming from a specific directory.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    register(OnFileChangeListener listener, String dirPath, String... globPatterns)
    Notifies the implementation of this interface that dirPath should be monitored for file system events.
    void
    Starts the service.
    void
    Notifies the implementation of this interface that listener should cease to be notified of file system events.
    void
    Unregisters all listeners.

    Methods inherited from interface edu.wisc.ssec.mcidasv.util.pathwatcher.Service

    isRunning, stop
  • Method Details

    • start

      void start()
      Description copied from interface: Service
      Starts the service. This method blocks until the service has completely started.
      Specified by:
      start in interface Service
    • register

      void register(OnFileChangeListener listener, String dirPath, String... globPatterns) throws IOException
      Notifies the implementation of this interface that dirPath should be monitored for file system events. If the changed file matches any of the globPatterns, listener should be notified.
      Parameters:
      listener - The listener.
      dirPath - The directory path.
      globPatterns - Zero or more file patterns to be matched against file names. If none provided, matches any file.
      Throws:
      IOException - If dirPath is not a directory.
    • unregister

      Notifies the implementation of this interface that listener should cease to be notified of file system events.
      Parameters:
      listener - Listener to unregister. Cannot be null.
    • unregisterAll

      Unregisters all listeners.