Package io.jmix.flowui.devserver
Class FileWatcher
java.lang.Object
io.jmix.flowui.devserver.FileWatcher
Watches for the file or sub-directory changes in the given directory.
-
Constructor Summary
ConstructorDescriptionFileWatcher
(com.vaadin.flow.function.SerializableConsumer<File> onChangeConsumer, File watchDirectory) Creates an instance of the file watcher for the given directory. -
Method Summary
-
Constructor Details
-
FileWatcher
public FileWatcher(com.vaadin.flow.function.SerializableConsumer<File> onChangeConsumer, File watchDirectory) throws IOException Creates an instance of the file watcher for the given directory.Reports the changed file or directory as a
File
instance to the provided consumer.Watches the files create/delete and directory create/delete events.
- Parameters:
onChangeConsumer
- to be called when any change detectedwatchDirectory
- the directory to watch for changes, cannot be empty- Throws:
IOException
-
-
Method Details
-
start
public void start()Starts the file watching. -
stop
Stops the file watching.- Throws:
IOException
- if an error occurs during stop
-