Package io.jmix.flowui.devserver
Class ThemeFilesSynchronizer
java.lang.Object
io.jmix.flowui.devserver.ThemeFilesSynchronizer
- All Implemented Interfaces:
- Serializable
Watches for the file or sub-directory changes in the given directory.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionThemeFilesSynchronizer(com.vaadin.flow.function.SerializableConsumer<File> onChangeConsumer, com.vaadin.flow.function.SerializablePredicate<File> fileFilter, File... watchDirectory) Creates an instance of the file watcher for the given directory taking into account the given file filter.ThemeFilesSynchronizer(com.vaadin.flow.function.SerializableConsumer<File> onChangeConsumer, File... watchDirectory) Creates an instance of the file watcher for the given directory.ThemeFilesSynchronizer(org.apache.commons.io.monitor.FileAlterationListener listener, com.vaadin.flow.function.SerializablePredicate<File> fileFilter, File... watchDirectory) Creates an instance of the file watcher for the given directory taking into account the given file filter.
- 
Method SummaryModifier and TypeMethodDescriptionvoidsetTimeout(long timeout) Sets the time interval between file/directory checks.voidstart()Starts the file watching.voidstop()Stops the file watching.voidstop(long stopInterval) Stops the file watching and waits for a given stop interval for watching thread to finish.
- 
Constructor Details- 
ThemeFilesSynchronizerpublic ThemeFilesSynchronizer(com.vaadin.flow.function.SerializableConsumer<File> onChangeConsumer, File... watchDirectory) Creates an instance of the file watcher for the given directory.Reports the changed file or directory as a Fileinstance to the provided consumer.Watches the files create/delete and directory create/delete events. - Parameters:
- onChangeConsumer- to be called when any change detected
- watchDirectory- the directory to watch for the changes, cannot be empty
 
- 
ThemeFilesSynchronizerpublic ThemeFilesSynchronizer(com.vaadin.flow.function.SerializableConsumer<File> onChangeConsumer, com.vaadin.flow.function.SerializablePredicate<File> fileFilter, File... watchDirectory) Creates an instance of the file watcher for the given directory taking into account the given file filter.Reports the changed file or directory as a Fileinstance to the provided consumer.Watches the files create/delete and directory create/delete events. - Parameters:
- fileFilter- defined if the given file or directory should be watched
- onChangeConsumer- to be called when any change detected
- watchDirectory- the directory to watch for the changes, cannot be empty
 
- 
ThemeFilesSynchronizerpublic ThemeFilesSynchronizer(org.apache.commons.io.monitor.FileAlterationListener listener, com.vaadin.flow.function.SerializablePredicate<File> fileFilter, File... watchDirectory) Creates an instance of the file watcher for the given directory taking into account the given file filter.Reports the changed file or directory as a Fileinstance to the provided consumer.Reports file and directory changes to the given listener. - Parameters:
- fileFilter- defined if the given file or directory should be watched
- listener- to be invoked once any changes detected
- watchDirectory- the directory to watch for the changes, cannot be empty
 
 
- 
- 
Method Details- 
startStarts the file watching.- Throws:
- Exception- if an error occurs during startup
 
- 
stopStops the file watching.- Throws:
- Exception- if an error occurs during stop
 
- 
stopStops the file watching and waits for a given stop interval for watching thread to finish.- Parameters:
- stopInterval- time interval to wait for the watching thread
- Throws:
- Exception- if an error occurs during stop
 
- 
setTimeoutpublic void setTimeout(long timeout) Sets the time interval between file/directory checks.- Parameters:
- timeout- time interval between file/directory checks
 
 
-