Package io.methvin.watcher
Interface DirectoryChangeListener
-
- All Known Implementing Classes:
ChangeSetListener
,OnTimeoutListener
- 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
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
isWatching()
The watcher will stop watching after this method returns false.static DirectoryChangeListener
of(DirectoryChangeListener... listeners)
void
onEvent(DirectoryChangeEvent event)
default void
onException(java.lang.Exception e)
A handler for uncaught exceptions.default void
onIdle(int count)
-
-
-
Method Detail
-
of
static DirectoryChangeListener of(DirectoryChangeListener... listeners)
-
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.
-
onIdle
default void onIdle(int count)
-
onException
default void onException(java.lang.Exception e)
A handler for uncaught exceptions. Throwing an exception from here will terminate the watcher.
-
-