|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ntnu.item.jt.system.LogFilter
public class LogFilter
A representation of the output format of a given antivirus engine. Keeps record of ways to interpret, analyze and filter an AVE's scan output.
Scanner
Constructor Summary | |
---|---|
LogFilter()
Constructor for a log filter that returns every line of the log file. |
|
LogFilter(String resultIdentifier)
Constructor for a log filter that looks for a certain identifier string in each line and returns every line containing it. |
|
LogFilter(String resultIdentifier,
String resultPrefix,
String resultSuffix)
Constructor for a log filter that looks for a certain identifier string in each line and extract the information between a given prefix and suffix in that string. |
Method Summary | |
---|---|
ArrayList<String> |
filter(File log)
Reads a log file and extracts parts of it based on the prefixes and suffixes associated with this instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogFilter(String resultIdentifier, String resultPrefix, String resultSuffix)
resultIdentifier
- string that identifies a line containing a match.resultPrefix
- unique string (for the line containing the match) identifying the beginning of the result (i.e. the actual match). If the parameter is null, it will be assumed the result is at the beginning of the line.resultSuffix
- unique string (for the line containing the match) identifying the end of the result (i.e. the actual match). If the parameter is null, it will be assumed the result is at the end of the line.public LogFilter(String resultIdentifier)
resultIdentifier
- string that identifies a line containing a match.public LogFilter()
Method Detail |
---|
public ArrayList<String> filter(File log) throws NoMatchFoundException, FileNotFoundException, IOException
log
- the log file to be filtered.
NoMatchFoundException
- no match was found during the scan, i.e. the scanned file was reported clean.
FileNotFoundException
- the input file to be parsed could not be found.
IOException
- an IO exception occured while reading the file before any result was found (if the exception is thrown after a result is found, it is ignored).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |