Class WatchServiceFileSystemWatcher
java.lang.Object
io.quarkus.deployment.dev.filesystem.watch.WatchServiceFileSystemWatcher
- All Implemented Interfaces:
Runnable
File system watcher service based on JDK7
WatchService. Instantiating this class will create a new thread,
that will run until close() is called.
NOTE: this was copied from Xnio, it provides more functionality than we currently need.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidrun()voidunwatchPath(Path directory, FileChangeCallback callback) voidwatchDirectoryRecursively(Path directory, FileChangeCallback callback) voidwatchFiles(Path directory, List<Path> monitoredFiles, FileChangeCallback callback)
-
Constructor Details
-
WatchServiceFileSystemWatcher
-
-
Method Details
-
run
public void run() -
watchDirectoryRecursively
-
watchFiles
- Parameters:
directory- a directory that will be watchedmonitoredFiles- list of monitored files relative to directory. An empty list will monitor all files.callback- callback called when a file is changed
-
unwatchPath
-
close
- Throws:
IOException
-