Package jetbrains.buildServer
Class StreamGobbler
- java.lang.Object
-
- java.lang.Thread
-
- jetbrains.buildServer.StreamGobbler
-
-
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 StreamGobbler(InputStream is)
StreamGobbler(InputStream inputStream, Integer maxAcceptedOutputSize, String commandDebug)
StreamGobbler(InputStream inputStream, Integer maxAcceptedOutputSize, String commandDebug, ByteArrayOutputStream outputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCommandDebug()
long
getLastActivityTimestamp()
byte[]
getReadBytes()
long
getReadLength()
String
getReadString(Charset encoding)
boolean
isOutputOverload()
Return true if not whole content was recorded, due to its large sizevoid
notifyProcessExit()
void
run()
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
StreamGobbler
public StreamGobbler(InputStream is)
-
StreamGobbler
public StreamGobbler(InputStream inputStream, @Nullable Integer maxAcceptedOutputSize, @NotNull String commandDebug)
- Parameters:
maxAcceptedOutputSize
- maximum threshold of the data in stream (in bytes), which will be read. If output size is larger, further output will be ignored. Default - null - no limit.commandDebug
- debug text for error messages from this StreamCobbler
-
StreamGobbler
public StreamGobbler(@NotNull InputStream inputStream, @Nullable Integer maxAcceptedOutputSize, @NotNull String commandDebug, @NotNull ByteArrayOutputStream outputStream)
-
-
Method Detail
-
notifyProcessExit
public void notifyProcessExit()
-
getReadString
public String getReadString(Charset encoding)
- Returns:
- content collected by this StreamGobbler as a string with given encoding
-
isOutputOverload
public boolean isOutputOverload()
Return true if not whole content was recorded, due to its large size
-
getReadBytes
public byte[] getReadBytes()
- Returns:
- content collected by this StreamGobbler as bytes
-
getLastActivityTimestamp
public long getLastActivityTimestamp()
- Returns:
- System.currentTimeMillis for the last moment when data was detected in output stream
-
getReadLength
public long getReadLength()
-
getCommandDebug
@NotNull public String getCommandDebug()
-
-