- java.lang.Object
-
- io.helidon.config.FileSystemWatcher.Builder
-
- All Implemented Interfaces:
Builder<FileSystemWatcher>,Supplier<FileSystemWatcher>
- Enclosing class:
- FileSystemWatcher
public static final class FileSystemWatcher.Builder extends Object implements Builder<FileSystemWatcher>
Fluent API builder forFileSystemWatcher.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileSystemWatcher.BuilderaddWatchServiceModifier(WatchEvent.Modifier modifier)Add a modifier of the watch service.FileSystemWatcherbuild()Build the instance from this builder.FileSystemWatcher.Builderconfig(Config metaConfig)Update this builder from meta configuration.FileSystemWatcher.Builderexecutor(ScheduledExecutorService executor)Executor to use for this watcher.FileSystemWatcher.Builderschedule(long initialDelay, long delay, TimeUnit timeUnit)Configure schedule of the file watcher.FileSystemWatcher.BuilderwatchServiceModifiers(List<WatchEvent.Modifier> modifiers)Set modifiers to use for the watch service.
-
-
-
Method Detail
-
build
public FileSystemWatcher build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<FileSystemWatcher>- Returns:
- instance of the built type
-
config
public FileSystemWatcher.Builder config(Config metaConfig)
Update this builder from meta configuration.Currently these options are supported:
initial-delay-millis- delay between the time this watcher is started and the time the first check is triggereddelay-millis- how often do we check the watcher service for changes
- Parameters:
metaConfig- configuration of file system watcher- Returns:
- updated builder instance
-
executor
public FileSystemWatcher.Builder executor(ScheduledExecutorService executor)
Executor to use for this watcher. The task is scheduled for regular execution and is only blocking a thread for the time needed to process changed files.- Parameters:
executor- executor service to use- Returns:
- updated builder instance
-
schedule
public FileSystemWatcher.Builder schedule(long initialDelay, long delay, TimeUnit timeUnit)
Configure schedule of the file watcher.- Parameters:
initialDelay- initial delay before regular scheduling startsdelay- delay between schedulestimeUnit- time unit of the delays- Returns:
- updated builer instance
-
addWatchServiceModifier
public FileSystemWatcher.Builder addWatchServiceModifier(WatchEvent.Modifier modifier)
Add a modifier of the watch service. Currently only implementation specific modifier are available, such ascom.sun.nio.file.SensitivityWatchEventModifier.- Parameters:
modifier- modifier to use- Returns:
- updated builder instance
-
watchServiceModifiers
public FileSystemWatcher.Builder watchServiceModifiers(List<WatchEvent.Modifier> modifiers)
Set modifiers to use for the watch service. Currently only implementation specific modifier are available, such ascom.sun.nio.file.SensitivityWatchEventModifier.- Parameters:
modifiers- modifiers to use (replacing current configuration)- Returns:
- updated builder instance
-
-