public class FileHelper extends java.lang.Object implements ACSRemoteErrorListener
The class read a file with the help of IOHelper and adds
a filter for the start and end dates and another one for the levels.
| Modifier and Type | Field and Description |
|---|---|
long |
endTime
The end time of the logs to read from file
|
LogTypeHelper |
maxLogLevel
The max log level to read from the file (inclusive)
|
LogTypeHelper |
minLogLevel
The min log level to read from the file (inclusive)
|
long |
startTime
The start time of the logs to read from file (>=0)
|
| Constructor and Description |
|---|
FileHelper(java.io.File inFile,
long start,
long end,
LogTypeHelper lowLvl,
LogTypeHelper hiLvl)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
errorReceived(java.lang.String xml)
The method is executed when an error happened building a log
from a string.
|
boolean |
loadLogs(ACSRemoteLogListener logListener,
IOPorgressListener ioListener,
ACSRemoteErrorListener errorListener)
Load the logs for the file.
|
void |
stopLoading()
Stop loading logs.
|
public final LogTypeHelper minLogLevel
public final LogTypeHelper maxLogLevel
public final long startTime
public final long endTime
public FileHelper(java.io.File inFile,
long start,
long end,
LogTypeHelper lowLvl,
LogTypeHelper hiLvl)
throws ZoomException
inFile - The file to read logs fromstart - The start time (>=0)end - The ending timelowlvl - The lowest log level to read (inclusive)hiLvl - The highest level to read (inclusive)java.io.IOException - If the file is unreadableZoomExceptionpublic boolean loadLogs(ACSRemoteLogListener logListener, IOPorgressListener ioListener, ACSRemoteErrorListener errorListener) throws ZoomException, java.io.FileNotFoundException
This method return errors in two ways:
false in case of errors parsing logs read from file
The error listener passed as parameter can be null.
In fact the error listener gets the strings of the logs that returned an error
while parsing. If the caller is not interested in those strings but only to
know if there were parsing errors then it will be enough for the caller to check
the value of the returned boolean.
logListener - The listener of the logs read from the fileioListener - The listener for the progress of loadingerrorListener - The listener of errors parsing logs (can'be null)false in case of errors loading logs;
true otherwiseZoomException - In case of errors creating filtersjava.io.FileNotFoundException - If the file was not foundpublic void errorReceived(java.lang.String xml)
ACSRemoteErrorListenererrorReceived in interface ACSRemoteErrorListenerxml - That string that caused the errorACSRemoteErrorListener.errorReceived(java.lang.String)public void stopLoading()
stopLoading does nothing if no load is in progress.