Class FileWatcher

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.lang.Runnable

    public class FileWatcher
    extends java.lang.Object
    implements java.lang.Runnable, java.lang.AutoCloseable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int SLEEP  
    • Constructor Summary

      Constructors 
      Constructor Description
      FileWatcher()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void run()  
      void stop()  
      void unwatch​(java.nio.file.Path path)  
      void watch​(java.nio.file.Path path, java.util.function.Consumer<java.nio.file.Path> callback)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileWatcher

        public FileWatcher()
    • Method Detail

      • unwatch

        public void unwatch​(java.nio.file.Path path)
      • watch

        public void watch​(java.nio.file.Path path,
                          java.util.function.Consumer<java.nio.file.Path> callback)
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • stop

        public void stop()
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable