public final class Shell
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Shell.Encoding
Singleton identifying the
Charset used for encoding/decoding interactions with the "shell"
command interpreter environment. |
static class |
Shell.Result
The
execute(Charset, String...) command execution result. |
| Modifier and Type | Method and Description |
|---|---|
static Shell.Result |
execute(java.nio.charset.Charset consoleEncoding,
java.lang.String... command)
Executes a command in the host and returns the command output, both stdout and stderr,
as a list of strings.
|
public static Shell.Result execute(java.nio.charset.Charset consoleEncoding, java.lang.String... command) throws java.io.IOException
consoleEncoding - the Charset to use for decoding the command responsecommand - the command to execute; this command is presented to
ProcessBuilder.command() and must be properly quoted for the OSjava.io.IOException - if an error is raised while executing the command or
retrieving the resultsCopyright © 2022. All rights reserved.