public class LogReader
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
LogReader.Closure |
static class |
LogReader.DateFilter |
static class |
LogReader.ErrorOnlyFilter |
static class |
LogReader.FilterNoop |
static class |
LogReader.IpFilter |
static class |
LogReader.Log |
static interface |
LogReader.LogFilter |
static interface |
LogReader.LogParser |
static class |
LogReader.Stats |
Constructor and Description |
---|
LogReader(LogReader.LogParser parser) |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args) |
void |
readAll(java.io.File dir,
java.io.FileFilter ff,
LogReader.Closure closure,
LogReader.LogFilter logf,
LogReader.Stats stat)
Read all the files in a directory and process them.
|
void |
scanLogFile(java.io.File file,
LogReader.Closure closure,
LogReader.LogFilter logf,
LogReader.Stats stat)
Read a log file.
|
public LogReader(LogReader.LogParser parser)
public void readAll(java.io.File dir, java.io.FileFilter ff, LogReader.Closure closure, LogReader.LogFilter logf, LogReader.Stats stat) throws java.io.IOException
dir
- read from this directoryff
- files must pass this filter (may be null)closure
- send each Log to this closurelogf
- filter out these Logs (may be null)stat
- accumulate statistics (may be null)java.io.IOException
- on read errorpublic void scanLogFile(java.io.File file, LogReader.Closure closure, LogReader.LogFilter logf, LogReader.Stats stat) throws java.io.IOException
file
- file to readclosure
- send each Log to this closurelogf
- filter out these Logs (may be null)stat
- accumulate statistics (may be null)java.io.IOException
- on read errorpublic static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException