java.lang.Object
io.helidon.config.MutabilitySupport
Mutability support for file based sources.
Provides support for polling based strategy
(poll(java.nio.file.Path, java.time.Duration, java.util.function.Consumer, java.util.function.Consumer)
) and
for file watching (watch(java.nio.file.Path, java.util.function.Consumer, java.util.function.Consumer)
).
-
Method Summary
-
Method Details
-
poll
public static Runnable poll(Path path, Duration duration, Consumer<Path> updater, Consumer<Path> cleaner) Start polling for changes.- Parameters:
path
- path to watchduration
- duration of pollingupdater
- consumer that reads the file content and updates properties (in case file is changed)cleaner
- runnable to clean the properties (in case file is deleted)- Returns:
- runnable to stop the file watcher
-
watch
Start watching a file for changes.- Parameters:
path
- path to watchupdater
- consumer that reads the file content and updates propertiescleaner
- runnable to clean the properties (in case file is deleted)- Returns:
- runnable to stop the file watcher
-