Interface DirectoryChangeListener

All Known Implementing Classes:
ChangeSetListener
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public interface DirectoryChangeListener
A listener that is called when file change events occur or when exceptions occur while watching.
  • Method Summary

    Modifier and Type Method Description
    default boolean isWatching()
    The watcher will stop watching after this method returns false.
    void onEvent​(DirectoryChangeEvent event)  
    default void onException​(java.lang.Exception e)
    A handler for uncaught exceptions.
  • Method Details

    • onEvent

      void onEvent​(DirectoryChangeEvent event) throws java.io.IOException
      Throws:
      java.io.IOException
    • isWatching

      default boolean isWatching()
      The watcher will stop watching after this method returns false.
    • onException

      default void onException​(java.lang.Exception e)
      A handler for uncaught exceptions. Throwing an exception from here will terminate the watcher.