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, onOverflowpublic LineReadWatcher(RandomAccessFile randomAccessFile, Charset charset, LineHandler lineHandler)
randomAccessFile - RandomAccessFilecharset - 编码lineHandler - 行处理器LineHandler实现public void onModify(WatchEvent<?> event, Path currentPath)
WatcheronModify in interface WatcheronModify in class IgnoreWatcherevent - 事件currentPath - 事件发生的当前Path路径Copyright © 2025. All rights reserved.