public class CmdOutputUtil extends Object
CmdBuilder or CmdSettings for output
on stdout and/or stderr.| Constructor and Description |
|---|
CmdOutputUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
executeForOutput(CmdBuilderBase<?> cmdBuilder)
Execute a Cmd for the given builder and return its stdout and stderr output
as a String using the default charset of this Java virtual machine.
|
static String |
executeForOutput(CmdSettings cmdSettings)
Execute a Cmd for the given settings and return its stdout and stderr output
as a String using the default charset of this Java virtual machine.
|
static String |
executeForStderr(CmdBuilderBase<?> cmdBuilder)
Execute a Cmd for the given builder and return its stderr output as a String
using the default charset of this Java virtual machine.
|
static String |
executeForStderr(CmdSettings cmdSettings)
Execute a Cmd for the given settings and return its stderr output as a String
using the default charset of this Java virtual machine.
|
static String |
executeForStdout(CmdBuilderBase<?> cmdBuilder)
Execute a Cmd for the given builder and return its stdout output as a String
using the default charset of this Java virtual machine.
|
static String |
executeForStdout(CmdSettings cmdSettings)
Execute a Cmd for the given settings and return its stdout output as a String
using the default charset of this Java virtual machine.
|
public static String executeForStdout(CmdBuilderBase<?> cmdBuilder) throws CmdException
The given builder will not be manipulated and can be re-used by the caller.
In case of an error, the captured output is also included in the exception thrown.
CmdExceptionpublic static String executeForStdout(CmdSettings cmdSettings) throws CmdException
The given settings will not be manipulated and can be re-used by the caller.
In case of an error, the captured output is also included in the exception thrown.
CmdExceptionpublic static String executeForStderr(CmdBuilderBase<?> cmdBuilder) throws CmdException
The given builder will not be manipulated and can be re-used by the caller.
In case of an error, the captured output is also included in the exception thrown.
CmdExceptionpublic static String executeForStderr(CmdSettings cmdSettings) throws CmdException
The given settings will not be manipulated and can be re-used by the caller.
In case of an error, the captured output is also included in the exception thrown.
CmdExceptionpublic static String executeForOutput(CmdBuilderBase<?> cmdBuilder) throws CmdException
The given settings will not be manipulated and can be re-used by the caller.
In case of an error, the captured output is also included in the exception thrown.
CmdExceptionpublic static String executeForOutput(CmdSettings cmdSettings) throws CmdException
The given settings will not be manipulated and can be re-used by the caller.
In case of an error, the captured output is also included in the exception thrown.
CmdExceptionCopyright © 2013–2019 mklinger GmbH. All rights reserved.