Package org.alfresco.util.exec
Class RuntimeExec.InputStreamReaderThread
- java.lang.Object
-
- java.lang.Thread
-
- org.alfresco.util.exec.RuntimeExec.InputStreamReaderThread
-
- All Implemented Interfaces:
Runnable
- Enclosing class:
- RuntimeExec
public static class RuntimeExec.InputStreamReaderThread extends Thread
Gobbles anInputStreamand writes it into aStringBufferThe reading of the input stream is buffered.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description InputStreamReaderThread(InputStream is, Charset charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToBuffer(String msg)StringgetBuffer()booleanisComplete()voidrun()voidwaitForCompletion()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
-
-
-
-
Constructor Detail
-
InputStreamReaderThread
public InputStreamReaderThread(InputStream is, Charset charset)
- Parameters:
is- an input stream to read - it will be wrapped in a buffer for reading
-
-
Method Detail
-
waitForCompletion
public void waitForCompletion()
Waits for the run to complete.Remember to
startthe thread first
-
addToBuffer
public void addToBuffer(String msg)
- Parameters:
msg- the message to add to the buffer
-
isComplete
public boolean isComplete()
-
getBuffer
public String getBuffer()
- Returns:
- Returns the current state of the buffer
-
-