|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
ca.bc.webarts.tools.StreamGobbler
A simple class to take an input stream and dump it out to the commandline with a prepended string. It is designed to run in its own thread so it can pump the data silently in the background.
Field Summary | |
(package private) boolean |
aborted_
the thread aborted flag. |
(package private) boolean |
capture_
a control flag that turns on/off the capturing of the input stream |
(package private) java.lang.StringBuffer |
captureBuffer_
The buffer used to store the input stream data IFF the capture has been turned on with the capture_ flag. |
boolean |
finishedGobbling_
Flag so we can signal the control/signal the threads end. |
(package private) java.lang.String |
input_
the input from in stream |
(package private) boolean |
inputGobbler_
signals if we are gobbling input instead of the default outputstreams. |
(package private) java.io.InputStream |
is_
The class InputStream that gets echoed to the designated output stream (default=System.out). |
(package private) java.lang.String |
lineSep_
the lin sep chars |
(package private) java.io.OutputStream |
os_
The location of any output. |
(package private) java.io.PrintStream |
ps_
The location of any output. |
(package private) java.lang.String |
type_
The string to get prepended to the output from the InputStream. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
StreamGobbler(java.io.InputStream inputstream,
java.lang.String string)
A Simple Constructor for the StreamGobbler object that ends up using System.out as the Output PrintStream. |
|
StreamGobbler(java.io.InputStream inputstream,
java.lang.String string,
java.io.PrintStream os)
Constructor for the StreamGobbler object that requires all parameters to be spec'd. |
|
StreamGobbler(java.lang.String input,
java.io.OutputStream os)
Constructor for the StreamGobbler object that gobbles input instead of the default outputstreams. |
Method Summary | |
void |
abort()
|
boolean |
getCapture()
Get Method for class field 'capture_'. |
java.lang.String |
getCapturedOutput()
Gets the inputStreams captured data. |
java.io.PrintStream |
getOs_()
Get Method for class field 'ps_'. |
void |
run()
Main processing method for the StreamGobbler object |
void |
setCapture(boolean capture)
Set Method for class field 'capture_'. |
void |
setOs_(java.io.PrintStream ps_)
Set Method for class field 'ps_'. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public boolean finishedGobbling_
java.io.InputStream is_
java.io.PrintStream ps_
java.io.OutputStream os_
java.lang.String type_
boolean inputGobbler_
java.lang.String lineSep_
java.lang.String input_
boolean aborted_
boolean capture_
java.lang.StringBuffer captureBuffer_
Constructor Detail |
public StreamGobbler(java.io.InputStream inputstream, java.lang.String string)
inputstream
- The stream to watch for input.string
- The string to get prepended to the output from the
InputStream before it gets pumped into the output
PrintStream.public StreamGobbler(java.io.InputStream inputstream, java.lang.String string, java.io.PrintStream os)
inputstream
- The stream to watch for input.string
- The string to get prepended to the output from the
InputStream before it gets pumped into the output
PrintStream.os
- An output PrintStream to send the data to.public StreamGobbler(java.lang.String input, java.io.OutputStream os)
os
- An output PrintStream to send the data to.Method Detail |
public void run()
public void abort()
public void setOs_(java.io.PrintStream ps_)
ps_
- is the value to set this class field to.public java.io.PrintStream getOs_()
public java.lang.String getCapturedOutput()
public void setCapture(boolean capture)
public boolean getCapture()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |