public abstract class AbstractDelayTracker extends Tracker
Modifier and Type | Field and Description |
---|---|
protected String |
charset
编码集
|
protected int |
delayMillis
延迟时间
|
protected FileOffsetMode |
fileOffsetMode
启动时文件偏移 处理模式
|
protected FileMinusMode |
minusMode
运行时文件大小减少 处理模式
|
protected FileNotFoundMode |
notFoundMode
启动时未找到文件 处理模式
|
protected int |
notFountTimes
启动时未找到文件 处理次数
|
protected long |
offset
开始监听的文件偏移量
= -1 从文件当前大小开始
= 0 从0开始
> 0 BYTE 从length - offset 开始
> 0 LINE 倒数第几行开始
|
protected RandomAccessFile |
reader
RandomAccessFile
|
protected File |
tailFile
追踪的文件
|
Constructor and Description |
---|
AbstractDelayTracker(File tailFile) |
AbstractDelayTracker(String tailFile) |
Modifier and Type | Method and Description |
---|---|
AbstractDelayTracker |
charset(String charset) |
void |
close()
安全关闭
|
AbstractDelayTracker |
delayMillis(int delayMillis) |
protected boolean |
init()
初始化
|
AbstractDelayTracker |
minusMode(FileMinusMode minusMode) |
AbstractDelayTracker |
notFoundMode(FileNotFoundMode notFoundMode) |
AbstractDelayTracker |
notFoundMode(FileNotFoundMode notFoundMode,
int notFountTimes) |
AbstractDelayTracker |
offset(FileOffsetMode fileOffsetMode,
long offset) |
AbstractDelayTracker |
offset(long offset) |
protected abstract void |
read()
读取
|
protected void |
resetSeek()
重新设置初始化位置
|
boolean |
setFileLastModifyTime()
设置文件最后更新时间
|
protected void |
setSeek()
设置初始化位置
|
void |
tail()
开启tail
|
String |
toString() |
protected File tailFile
protected RandomAccessFile reader
protected String charset
protected int delayMillis
protected FileOffsetMode fileOffsetMode
protected long offset
= -1 从文件当前大小开始 = 0 从0开始 > 0 BYTE 从length - offset 开始 > 0 LINE 倒数第几行开始
protected FileNotFoundMode notFoundMode
protected int notFountTimes
protected FileMinusMode minusMode
public AbstractDelayTracker(String tailFile)
public AbstractDelayTracker(File tailFile)
public void tail()
Tracker
protected boolean init() throws IOException
IOException
- IOExceptionprotected void setSeek() throws IOException
IOException
protected void resetSeek() throws IOException
IOException
protected abstract void read() throws IOException
IOException
- IOExceptionpublic boolean setFileLastModifyTime()
public AbstractDelayTracker charset(String charset)
public AbstractDelayTracker offset(long offset)
public AbstractDelayTracker offset(FileOffsetMode fileOffsetMode, long offset)
public AbstractDelayTracker delayMillis(int delayMillis)
public AbstractDelayTracker notFoundMode(FileNotFoundMode notFoundMode)
public AbstractDelayTracker notFoundMode(FileNotFoundMode notFoundMode, int notFountTimes)
public AbstractDelayTracker minusMode(FileMinusMode minusMode)
public void close()
SafeCloseable
Copyright © 2024. All rights reserved.