org.processmining.framework.log
Class LogFile

java.lang.Object
  extended by org.processmining.framework.log.LogFile

public abstract class LogFile
extends java.lang.Object

Encapsulates a log file.

Use the getInstance method to obtain an instance.

Currently, normal files are supported by giving the file name. Also, files inside zip files are supported by giving the resource string zip://zip_file_name#zip_file_entry_name.

Version:
1.0
Author:
Peter van den Brand

Field Summary
protected  javax.swing.JProgressBar progressBar
          If not null, this progress bar will be used to report progress feedback information while loading the log file.
 
Constructor Summary
protected LogFile()
           
 
Method Summary
abstract  java.io.InputStream getInputStream()
          Returns a new InputStream for reading from this LogFile.
static LogFile getInstance(java.lang.String resource)
          Create a LogFile instance for the given resource.
abstract  java.lang.String getShortName()
          Returns a short descriptive name of the file.
 void setProgressBar(javax.swing.JProgressBar aProgressBar)
          Sets the progress bar to which feedback while loading the log will be transmitted.
abstract  java.lang.String toString()
          Returns the full filename including path info of the log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

progressBar

protected javax.swing.JProgressBar progressBar
If not null, this progress bar will be used to report progress feedback information while loading the log file.

Constructor Detail

LogFile

protected LogFile()
Method Detail

getInputStream

public abstract java.io.InputStream getInputStream()
                                            throws java.io.IOException
Returns a new InputStream for reading from this LogFile. Note that the returned InputStream has to be a newly created InputStream that will start reading at the beginning of the log.

Returns:
a new InputStream for reading from this LogFile.
Throws:
java.io.IOException - in case the file could not be opened

getShortName

public abstract java.lang.String getShortName()
Returns a short descriptive name of the file. This is typically only the filename without the path information.

Returns:
a short descriptive name of the file.

toString

public abstract java.lang.String toString()
Returns the full filename including path info of the log file. Important: LogFile.getInstance(thisLogFile.toString()) should give a duplicate of the thisLogFile object.

Overrides:
toString in class java.lang.Object
Returns:
the full filename including path info of the log file

setProgressBar

public void setProgressBar(javax.swing.JProgressBar aProgressBar)
Sets the progress bar to which feedback while loading the log will be transmitted. May be voided by providing null (default).

Parameters:
aProgressBar -

getInstance

public static LogFile getInstance(java.lang.String resource)
Create a LogFile instance for the given resource. Currently, normal files are supported by giving the file name. Also, files inside zip files are supported by giving the resource string zip://zip_file_name#zip_file_entry_name.

Parameters:
resource - the log file to open
Returns:
a LogFile instance for the given resource