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