public interface ShellTool
Modifier and Type | Field and Description |
---|---|
static ConfigKey<java.lang.String> |
PROP_DIRECT_HEADER |
static ConfigKey<java.io.OutputStream> |
PROP_ERR_STREAM |
static ConfigKey<java.lang.Boolean> |
PROP_EXEC_ASYNC |
static ConfigKey<Duration> |
PROP_EXEC_ASYNC_POLLING_TIMEOUT |
static ConfigKey<Duration> |
PROP_EXEC_TIMEOUT |
static ConfigKey<java.lang.String> |
PROP_LOCAL_TEMP_DIR |
static ConfigKey<java.lang.Boolean> |
PROP_NO_DELETE_SCRIPT |
static ConfigKey<java.lang.Boolean> |
PROP_NO_EXTRA_OUTPUT |
static ConfigKey<java.io.OutputStream> |
PROP_OUT_STREAM |
static ConfigKey<java.lang.Boolean> |
PROP_RUN_AS_ROOT |
static ConfigKey<java.lang.String> |
PROP_SCRIPT_DIR |
static ConfigKey<java.lang.String> |
PROP_SCRIPT_HEADER |
static ConfigKey<java.lang.String> |
PROP_SEPARATOR |
static ConfigKey<java.lang.String> |
PROP_SUMMARY |
Modifier and Type | Method and Description |
---|---|
int |
execCommands(java.util.Map<java.lang.String,?> properties,
java.util.List<java.lang.String> commands) |
int |
execCommands(java.util.Map<java.lang.String,?> properties,
java.util.List<java.lang.String> commands,
java.util.Map<java.lang.String,?> env)
Executes the set of commands using ssh exec.
|
int |
execScript(java.util.Map<java.lang.String,?> props,
java.util.List<java.lang.String> commands) |
int |
execScript(java.util.Map<java.lang.String,?> props,
java.util.List<java.lang.String> commands,
java.util.Map<java.lang.String,?> env)
Executes the set of commands in a shell script.
|
static final ConfigKey<java.lang.String> PROP_LOCAL_TEMP_DIR
static final ConfigKey<java.lang.Boolean> PROP_RUN_AS_ROOT
static final ConfigKey<java.io.OutputStream> PROP_OUT_STREAM
static final ConfigKey<java.io.OutputStream> PROP_ERR_STREAM
static final ConfigKey<java.lang.Boolean> PROP_NO_EXTRA_OUTPUT
static final ConfigKey<java.lang.String> PROP_SEPARATOR
static final ConfigKey<java.lang.String> PROP_SCRIPT_DIR
static final ConfigKey<java.lang.String> PROP_SCRIPT_HEADER
static final ConfigKey<java.lang.String> PROP_DIRECT_HEADER
static final ConfigKey<java.lang.Boolean> PROP_NO_DELETE_SCRIPT
static final ConfigKey<java.lang.String> PROP_SUMMARY
static final ConfigKey<java.lang.Boolean> PROP_EXEC_ASYNC
int execScript(java.util.Map<java.lang.String,?> props, java.util.List<java.lang.String> commands, java.util.Map<java.lang.String,?> env)
Optional properties are the same common ones as for execCommands(Map, List, Map)
with the addition of:
int execScript(java.util.Map<java.lang.String,?> props, java.util.List<java.lang.String> commands)
execScript(Map, List, Map)
int execCommands(java.util.Map<java.lang.String,?> properties, java.util.List<java.lang.String> commands, java.util.Map<java.lang.String,?> env)
execScript(Map, List, Map)
),
but is not suitable if you need env values which are only set on a fully-fledged shell,
or if you want the entire block executed with root permission.
Common optional properties (which also apply to execScript(Map, List, Map)
) are:
PROP_OUT_STREAM
PROP_ERR_STREAM
PROP_SEPARATOR
(for some modes)
PROP_NO_EXTRA_OUTPUT
(often there is no extra output here)
PROP_RUN_AS_ROOT
is not typically supported here. Prefer execScript(Map, List, Map)
).int execCommands(java.util.Map<java.lang.String,?> properties, java.util.List<java.lang.String> commands)
execCommands(Map, List, Map)