Class FilesystemObserver

java.lang.Object
de.galan.commons.io.file.FilesystemObserver

public class FilesystemObserver extends Object
File- and DirectoryListener can be registered at the observer to recevive notifications if they change. Uses internally the WatchService.
  • Constructor Details

    • FilesystemObserver

      public FilesystemObserver()
  • Method Details

    • createWatcherThread

      protected Thread createWatcherThread()
    • start

      public void start()
    • stop

      public void stop()
    • processEvents

      protected void processEvents()
    • notifyDirectoryListener

      protected void notifyDirectoryListener(de.galan.commons.io.file.ProxyDirectoryListener proxyDirectoryListener, WatchEvent.Kind<?> kind, Path path)
    • notifyFileListener

      protected void notifyFileListener(de.galan.commons.io.file.ProxyFileListener fileListener, WatchEvent.Kind<?> kind, Path path)
    • registerFileListener

      public void registerFileListener(FileListener fileListener, File file) throws IOException
      Throws:
      IOException
    • registerDirectoryListener

      public void registerDirectoryListener(FileListener directoryListener, File directory, boolean recursive) throws IOException
      Throws:
      IOException
    • registerDirectoryListener

      protected void registerDirectoryListener(FileListener directoryListener, Path directory, boolean recursive) throws IOException
      Throws:
      IOException
    • registerDirectoryListenerInternal

      protected void registerDirectoryListenerInternal(de.galan.commons.io.file.ProxyDirectoryListener proxyDirectoryListener) throws IOException
      Throws:
      IOException