net.sf.sparql.benchmarking.monitoring
Class FileProgressListener

java.lang.Object
  extended by net.sf.sparql.benchmarking.monitoring.StreamProgressListener
      extended by net.sf.sparql.benchmarking.monitoring.FileProgressListener
All Implemented Interfaces:
ProgressListener

public class FileProgressListener
extends StreamProgressListener

A Progress Listener that writes the informational messages to a file

File is only opened when benchmarking starts, if the file exists then it may either overwrite the existing file or append to it depending on the constructor arguments used. Default behaviour is to overwrite.

Author:
rvesse

Constructor Summary
FileProgressListener(String filename)
          Creates a new File Progress Listener which will overwrite a file of the given name
FileProgressListener(String filename, boolean append)
          Creates a new File Progress Listener which may append to the file of the given name depending on the append parameter
 
Method Summary
protected  OutputStream openStream()
          Opens the File as an Output Stream returning null if the file cannot be used for output
 
Methods inherited from class net.sf.sparql.benchmarking.monitoring.StreamProgressListener
afterOperation, afterOperationMix, beforeOperation, beforeOperationMix, finish, hasSwitchedThreads, progress, setForceThreadedOutput, start, updateThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileProgressListener

public FileProgressListener(String filename,
                            boolean append)
Creates a new File Progress Listener which may append to the file of the given name depending on the append parameter

Parameters:
filename - Filename
append - Whether to append to the file, if false file will be overwritten if it exists

FileProgressListener

public FileProgressListener(String filename)
Creates a new File Progress Listener which will overwrite a file of the given name

Parameters:
filename - Filename
Method Detail

openStream

protected OutputStream openStream()
Opens the File as an Output Stream returning null if the file cannot be used for output

Overrides:
openStream in class StreamProgressListener
Returns:
File Output Stream


Copyright © 2014. All Rights Reserved.