mk.fsgrep.util
Class OutputRedirector

java.lang.Object
  extended by mk.fsgrep.util.OutputRedirector

public class OutputRedirector
extends java.lang.Object

A utility to redirect stdout/stderr to a file.

Author:
Murali Krishnan

Field Summary
protected static java.io.File LOG_FILE
          The file where out/err would be redirected.
 
Constructor Summary
OutputRedirector()
           
 
Method Summary
protected  java.io.FileOutputStream getFileStream()
           
static OutputRedirector getInstance()
           
protected  java.io.PrintStream getOriginalErr()
           
protected  java.io.PrintStream getOriginalOut()
           
protected  java.io.PrintStream getPrintStream()
           
 void redirect()
           
 void restore()
           
protected  void setFileStream(java.io.FileOutputStream val)
           
protected  void setOriginalErr(java.io.PrintStream val)
           
protected  void setOriginalOut(java.io.PrintStream val)
           
protected  void setPrintStream(java.io.PrintStream val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_FILE

protected static final java.io.File LOG_FILE
The file where out/err would be redirected.

Constructor Detail

OutputRedirector

public OutputRedirector()
Method Detail

getInstance

public static OutputRedirector getInstance()

getFileStream

protected java.io.FileOutputStream getFileStream()

getPrintStream

protected java.io.PrintStream getPrintStream()

getOriginalOut

protected java.io.PrintStream getOriginalOut()

getOriginalErr

protected java.io.PrintStream getOriginalErr()

setFileStream

protected void setFileStream(java.io.FileOutputStream val)

setPrintStream

protected void setPrintStream(java.io.PrintStream val)

setOriginalOut

protected void setOriginalOut(java.io.PrintStream val)

setOriginalErr

protected void setOriginalErr(java.io.PrintStream val)

redirect

public void redirect()

restore

public void restore()


Copyright © 2009. All Rights Reserved.