Package org.aoju.bus.core.io.watcher
Interface Watcher
- All Known Implementing Classes:
DelayWatcher,IgnoreWatcher,LineReadWatcher,SimpleWatcher,WatcherChain
public interface Watcher
观察者(监视器)
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptionvoidonCreate(WatchEvent<?> event, Path currentPath) 文件创建时执行的方法voidonDelete(WatchEvent<?> event, Path currentPath) 文件删除时执行的方法voidonModify(WatchEvent<?> event, Path currentPath) 文件修改时执行的方法 文件修改可能触发多次voidonOverflow(WatchEvent<?> event, Path currentPath) 事件丢失或出错时执行的方法
-
Method Details
-
onCreate
文件创建时执行的方法- Parameters:
event- 事件currentPath- 事件发生的当前Path路径
-
onModify
文件修改时执行的方法 文件修改可能触发多次- Parameters:
event- 事件currentPath- 事件发生的当前Path路径
-
onDelete
文件删除时执行的方法- Parameters:
event- 事件currentPath- 事件发生的当前Path路径
-
onOverflow
事件丢失或出错时执行的方法- Parameters:
event- 事件currentPath- 事件发生的当前Path路径
-