Package org.alfresco.util.exec
Class RuntimeExec.InputStreamReaderThread
- java.lang.Object
-
- java.lang.Thread
-
- org.alfresco.util.exec.RuntimeExec.InputStreamReaderThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- RuntimeExec
public static class RuntimeExec.InputStreamReaderThread extends java.lang.Thread
Gobbles anInputStream
and writes it into aStringBuffer
The reading of the input stream is buffered.
-
-
Constructor Summary
Constructors Constructor Description InputStreamReaderThread(java.io.InputStream is, java.nio.charset.Charset charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToBuffer(java.lang.String msg)
java.lang.String
getBuffer()
boolean
isComplete()
void
run()
void
waitForCompletion()
Waits for the run to complete.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
waitForCompletion
public void waitForCompletion()
Waits for the run to complete.Remember to
start
the thread first
-
addToBuffer
public void addToBuffer(java.lang.String msg)
- Parameters:
msg
- the message to add to the buffer
-
isComplete
public boolean isComplete()
-
getBuffer
public java.lang.String getBuffer()
- Returns:
- Returns the current state of the buffer
-
-