Package engineering.swat.watch.impl.jdk
Class JDKDirectoryWatch
- java.lang.Object
-
- engineering.swat.watch.impl.jdk.JDKBaseWatch
-
- engineering.swat.watch.impl.jdk.JDKDirectoryWatch
-
- All Implemented Interfaces:
ActiveWatch
,EventHandlingWatch
,Closeable
,AutoCloseable
public class JDKDirectoryWatch extends JDKBaseWatch
-
-
Field Summary
-
Fields inherited from class engineering.swat.watch.impl.jdk.JDKBaseWatch
eventFilter, eventHandler, exec, path, started
-
-
Constructor Summary
Constructors Constructor Description JDKDirectoryWatch(Path directory, Executor exec, BiConsumer<EventHandlingWatch,WatchEvent> eventHandler, Predicate<WatchEvent> eventFilter)
JDKDirectoryWatch(Path directory, Executor exec, BiConsumer<EventHandlingWatch,WatchEvent> eventHandler, Predicate<WatchEvent> eventFilter, boolean nativeRecursive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
WatchScope
getScope()
Gets the scope of this watch.void
handleEvent(WatchEvent e)
Handles `event`.boolean
isClosed()
protected void
start()
Starts this watch.-
Methods inherited from class engineering.swat.watch.impl.jdk.JDKBaseWatch
getPath, open, startIfFirstTime, translate, translate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface engineering.swat.watch.impl.EventHandlingWatch
relativize
-
-
-
-
Constructor Detail
-
JDKDirectoryWatch
public JDKDirectoryWatch(Path directory, Executor exec, BiConsumer<EventHandlingWatch,WatchEvent> eventHandler, Predicate<WatchEvent> eventFilter)
-
JDKDirectoryWatch
public JDKDirectoryWatch(Path directory, Executor exec, BiConsumer<EventHandlingWatch,WatchEvent> eventHandler, Predicate<WatchEvent> eventFilter, boolean nativeRecursive)
-
-
Method Detail
-
isClosed
public boolean isClosed()
-
getScope
public WatchScope getScope()
Description copied from interface:ActiveWatch
Gets the scope of this watch.
-
handleEvent
public void handleEvent(WatchEvent e)
Description copied from interface:EventHandlingWatch
Handles `event`. The purpose of this method is to trigger the event handler of this watch "from the outside" (in addition to having native file system libraries trigger the event handler "from the inside"). This is useful to report synthetic events (e.g., while handling overflows).- Specified by:
handleEvent
in interfaceEventHandlingWatch
- Overrides:
handleEvent
in classJDKBaseWatch
-
close
public void close() throws IOException
- Throws:
IOException
-
start
protected void start() throws IOException
Description copied from class:JDKBaseWatch
Starts this watch.- Specified by:
start
in classJDKBaseWatch
- Throws:
IOException
- When an I/O exception of some sort has occurred (e.g., a nested watch failed to start)
-
-