public class ShellCommandRunnerImpl extends Object implements ShellCommandRunner
| Constructor and Description |
|---|
ShellCommandRunnerImpl() |
| Modifier and Type | Method and Description |
|---|---|
String |
execCommand(Map<String,String> env,
String... cmd)
Method to execute a shell command.
|
String |
execCommand(Map<String,String> env,
String[] cmd,
long timeout)
Method to execute a shell command.
|
String |
execCommand(String... cmd)
Method to execute a shell command.
|
String |
getTokenSeparatorRegex()
Token separator regex used to parse Shell tool outputs.
|
public String execCommand(String... cmd) throws IOException
ShellCommandRunnerMethod to execute a shell command. Covers most of the simple cases without requiring the user to implement the ShellUtils interface.
execCommand in interface ShellCommandRunnercmd - shell command to execute.IOExceptionpublic String execCommand(Map<String,String> env, String[] cmd, long timeout) throws IOException
ShellCommandRunnerMethod to execute a shell command. Covers most of the simple cases without requiring the user to implement the ShellUtils interface.
execCommand in interface ShellCommandRunnerenv - the map of environment key=valuecmd - shell command to execute.timeout - time in milliseconds after which script should be marked timeoutIOExceptionpublic String execCommand(Map<String,String> env, String... cmd) throws IOException
ShellCommandRunnerMethod to execute a shell command. Covers most of the simple cases without requiring the user to implement the ShellUtils interface.
execCommand in interface ShellCommandRunnerenv - the map of environment key=valuecmd - shell command to execute.IOExceptionpublic String getTokenSeparatorRegex()
ShellCommandRunnerToken separator regex used to parse Shell tool outputs.
getTokenSeparatorRegex in interface ShellCommandRunnerCopyright © 2021 The Apache Software Foundation. All rights reserved.