We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
com.vaadin.base.devserver.
Package com.vaadin.base.devserver
Class FileWatcher
java.lang.Object
com.vaadin.base.devserver.FileWatcher
Watches for the file or sub-directory changes in the given directory.
-
Constructor Summary
ConstructorsConstructorDescriptionFileWatcher
(SerializableConsumer<File> onChangeConsumer, File watchDirectory) Creates an instance of the file watcher for the given directory.
-
Method Summary
-
Constructor Details
-
FileWatcher
public FileWatcher(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 emptyThrows:
-
-
Method Details
-
start
public void start()Starts the file watching.
-
stop
Stops the file watching.
Throws:
IOException
- if an error occurs during stop
-