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
ShellCommandRunner
Method to execute a shell command. Covers most of the simple cases without requiring the user to implement the ShellUtils
interface.
execCommand
in interface ShellCommandRunner
cmd
- shell command to execute.IOException
public String execCommand(Map<String,String> env, String[] cmd, long timeout) throws IOException
ShellCommandRunner
Method to execute a shell command. Covers most of the simple cases without requiring the user to implement the ShellUtils
interface.
execCommand
in interface ShellCommandRunner
env
- the map of environment key=valuecmd
- shell command to execute.timeout
- time in milliseconds after which script should be marked timeoutIOException
public String execCommand(Map<String,String> env, String... cmd) throws IOException
ShellCommandRunner
Method to execute a shell command. Covers most of the simple cases without requiring the user to implement the ShellUtils
interface.
execCommand
in interface ShellCommandRunner
env
- the map of environment key=valuecmd
- shell command to execute.IOException
public String getTokenSeparatorRegex()
ShellCommandRunner
Token separator regex used to parse Shell tool outputs
getTokenSeparatorRegex
in interface ShellCommandRunner
Copyright © 2019 The Apache Software Foundation. All rights reserved.