public class LineReadWatcher extends SimpleWatcher implements Runnable
Constructor and Description |
---|
LineReadWatcher(RandomAccessFile randomAccessFile,
Charset charset,
LineHandler lineHandler)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
onModify(WatchEvent<?> event,
Path currentPath)
文件修改时执行的方法
文件修改可能触发多次 |
void |
run() |
onCreate, onDelete, onOverflow
public LineReadWatcher(RandomAccessFile randomAccessFile, Charset charset, LineHandler lineHandler)
randomAccessFile
- RandomAccessFile
charset
- 编码lineHandler
- 行处理器LineHandler
实现public void onModify(WatchEvent<?> event, Path currentPath)
Watcher
onModify
in interface Watcher
onModify
in class IgnoreWatcher
event
- 事件currentPath
- 事件发生的当前Path路径Copyright © 2024. All rights reserved.