Class FileWatcher
java.lang.Object
dev.engine.core.asset.FileWatcher
Watches a directory for file modifications and dispatches callbacks.
Uses the JDK
WatchService on a daemon thread.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(String path, Runnable callback) Registers a callback for when the given file path is modified.voidstart()Starts watching the directory for MODIFY events on a daemon thread.voidstop()Stops the file watcher and its daemon thread.
-
Constructor Details
-
FileWatcher
-
-
Method Details
-
start
public void start()Starts watching the directory for MODIFY events on a daemon thread. -
addListener
-
stop
public void stop()Stops the file watcher and its daemon thread.
-