public class LogDelete
extends java.lang.Thread
Constructor and Description |
---|
LogDelete()
Initialize.
|
LogDelete(java.lang.String folderPath,
int days)
Initialize.
|
Modifier and Type | Method and Description |
---|---|
void |
addLogPathWithSaveDays(java.lang.String folderPath,
int days)
Add the folder path to save Log file.
|
void |
close()
Close.
|
boolean |
removeLogPath(java.lang.String folderPath)
Earmark the folder to Delete the Log file.
|
void |
requestDelete()
Request that deletes Log file.
|
void |
run() |
void |
setCheckTime(java.time.Duration interval)
Checking the expired Log files each interval time, which is needed to delete.
|
java.lang.String |
toString() |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
public LogDelete(java.lang.String folderPath, int days)
folderPath
- The path that targets file.days
- keep dayspublic LogDelete()
public void addLogPathWithSaveDays(java.lang.String folderPath, int days)
folderPath
- the folder path to save Log filedays
- reserve days(positive number)public boolean removeLogPath(java.lang.String folderPath)
folderPath
- the folder path to Delete the Log filepublic void setCheckTime(java.time.Duration interval)
interval
- Checking interval timepublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void close()
public void requestDelete()
public java.lang.String toString()
toString
in class java.lang.Thread