Shell.CommandOutput
public final class Shell.CommandOutput
The output of a shell command executed via Shell.command. This class offers access to the stdOut and stdErr of the launched command, with utility methods to wait for the full output or parse the stream incrementally.
Summary
Public constructors |
|---|
CommandOutput(@NonNull String command, @NonNull ShellProcess shellProcess) |
Public methods |
|
|---|---|
final @NonNull String |
Awaits the process termination and returns the full stderr of the launched command. |
final @NonNull InputStream |
Allows incrementally consuming the stderr of a single command as an |
final @NonNull String |
Awaits the process termination and returns the full stdout of the launched command. |
final @NonNull InputStream |
Allows incrementally consuming the stdout of a single command as an |
final boolean |
Returns whether the launched shell command is still running. |
Public constructors
CommandOutput
public CommandOutput(@NonNull String command, @NonNull ShellProcess shellProcess)
Public methods
getStdErr
public final @NonNull String getStdErr()
Awaits the process termination and returns the full stderr of the launched command.
getStdErrStream
public final @NonNull InputStream getStdErrStream()
Allows incrementally consuming the stderr of a single command as an InputStream.
getStdOut
public final @NonNull String getStdOut()
Awaits the process termination and returns the full stdout of the launched command.
getStdOutStream
public final @NonNull InputStream getStdOutStream()
Allows incrementally consuming the stdout of a single command as an InputStream.
isRunning
public final boolean isRunning()
Returns whether the launched shell command is still running.