Package engineering.swat.watch.impl.jdk
Class JDKFileTreeWatch
- java.lang.Object
-
- engineering.swat.watch.impl.jdk.JDKBaseWatch
-
- engineering.swat.watch.impl.jdk.JDKFileTreeWatch
-
- All Implemented Interfaces:
ActiveWatch
,EventHandlingWatch
,Closeable
,AutoCloseable
public class JDKFileTreeWatch extends JDKBaseWatch
-
-
Field Summary
-
Fields inherited from class engineering.swat.watch.impl.jdk.JDKBaseWatch
eventFilter, eventHandler, exec, path, started
-
-
Constructor Summary
Constructors Constructor Description JDKFileTreeWatch(Path rootPath, Path relativePathParent, Executor exec, BiConsumer<EventHandlingWatch,WatchEvent> eventHandler, Predicate<WatchEvent> eventFilter)
JDKFileTreeWatch(Path fullPath, Executor exec, BiConsumer<EventHandlingWatch,WatchEvent> eventHandler, Predicate<WatchEvent> eventFilter)
-
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 event)
Handles `event`.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
-
JDKFileTreeWatch
public JDKFileTreeWatch(Path fullPath, Executor exec, BiConsumer<EventHandlingWatch,WatchEvent> eventHandler, Predicate<WatchEvent> eventFilter)
-
JDKFileTreeWatch
public JDKFileTreeWatch(Path rootPath, Path relativePathParent, Executor exec, BiConsumer<EventHandlingWatch,WatchEvent> eventHandler, Predicate<WatchEvent> eventFilter)
-
-
Method Detail
-
getScope
public WatchScope getScope()
Description copied from interface:ActiveWatch
Gets the scope of this watch.
-
handleEvent
public void handleEvent(WatchEvent event)
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)
-
-