java.lang.Runnable@Private
public class FileMonitoringTimerTask
extends java.util.TimerTask
| Constructor | Description |
|---|---|
FileMonitoringTimerTask(java.nio.file.Path filePath,
java.util.function.Consumer<java.nio.file.Path> onFileChange,
java.util.function.Consumer<java.lang.Throwable> onChangeFailure) |
|
FileMonitoringTimerTask(java.util.List<java.nio.file.Path> filePaths,
java.util.function.Consumer<java.nio.file.Path> onFileChange,
java.util.function.Consumer<java.lang.Throwable> onChangeFailure) |
Create file monitoring task to be scheduled using a standard
Java
Timer instance. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
run() |
public FileMonitoringTimerTask(java.nio.file.Path filePath,
java.util.function.Consumer<java.nio.file.Path> onFileChange,
java.util.function.Consumer<java.lang.Throwable> onChangeFailure)
filePath - The file to monitor.onFileChange - What to do when the file changes.onChangeFailure - What to do when onFileChange
throws an exception.public FileMonitoringTimerTask(java.util.List<java.nio.file.Path> filePaths,
java.util.function.Consumer<java.nio.file.Path> onFileChange,
java.util.function.Consumer<java.lang.Throwable> onChangeFailure)
Timer instance.filePaths - The path to the file to monitor.onFileChange - The function to call when the file has changed.onChangeFailure - The function to call when an exception is
thrown during the file change processing.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.