org.jscience.net
Class ServerLogFile

java.lang.Object
  extended by java.io.File
      extended by org.jscience.io.ExtendedFile
          extended by org.jscience.net.ServerLogFile
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<java.io.File>, ServerLog

public class ServerLogFile
extends ExtendedFile
implements ServerLog

ServerLogFile implements a web-server log based on a standard log file. If a given logfile format is different so that it cannot be parsed by this implementation, you can simply subclass this implementation and overwrite the parseLine(String) method.

See Also:
ServerLogEntry, Serialized Form

Nested Class Summary
protected  class ServerLogFile.ServerLogEntryEnumerator
           
 
Field Summary
protected  java.text.SimpleDateFormat dateFormat
           
 
Fields inherited from class java.io.File
pathSeparatorChar, separator, separatorChar
 
Constructor Summary
ServerLogFile(java.io.File file)
           
ServerLogFile(java.lang.String fileName)
           
 
Method Summary
 java.util.Enumeration<ServerLogEntry> getServerLogEntryEnumerator(Filter<ServerLogEntry> filter)
          returns an Enumeration of all ServerLogEntry objects that are accepted by the given filter or all ServerLogEntries if the filter is null.
protected  ServerLogEntry parseLine(java.lang.String line)
          parses a single line from the log file and constructs a ServerLogEntry
 
Methods inherited from class org.jscience.io.ExtendedFile
append, clear, compareContent, compareContent, compress, compressTo, copyTo, copyTo, count, decrypt, directoryCompare, directoryCompare, encrypt, fileCompareText, fileCompareText, getContentAsBytes, getContentAsString, getContentAsString, getFileExtension, getFileRelativeTo, getFileTypes, hasParent, indexOf, indexOf, indexOf, length, listFilesInTree, listFilesInTree, listFilesInTree, listSubDirs, loadObject, loadObject, loadProperties, objectEnumerator, objectEnumerator, objectEnumerator, removeTree, replace, replace, storeProperties, synchronizeDir, synchronizeDir, synchronizeDir, synchronizeDir, synchronizeDir, touch, uncompressTo, unzipTo, unzipTo, unzipTo, unzipTo, writeBytes, writeln, writeObject, writeStackTrace, writeStackTrace, writeText, zipTo, zipTo, zipTo
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dateFormat

protected java.text.SimpleDateFormat dateFormat
Constructor Detail

ServerLogFile

public ServerLogFile(java.lang.String fileName)

ServerLogFile

public ServerLogFile(java.io.File file)
Method Detail

getServerLogEntryEnumerator

public java.util.Enumeration<ServerLogEntry> getServerLogEntryEnumerator(Filter<ServerLogEntry> filter)
Description copied from interface: ServerLog
returns an Enumeration of all ServerLogEntry objects that are accepted by the given filter or all ServerLogEntries if the filter is null.

Specified by:
getServerLogEntryEnumerator in interface ServerLog
Returns:
an Enumeration of ServerLogEntry objects; note that there may be null values in the Enumeration, if the entry couldn't be properly parsed.
See Also:
ServerLogEntry

parseLine

protected ServerLogEntry parseLine(java.lang.String line)
parses a single line from the log file and constructs a ServerLogEntry