public class ShellExecutor extends Object implements Executor
Executor
interface. Use simple shell exec.Modifier and Type | Field and Description |
---|---|
protected static Pattern |
COMMAND_SPLIT
Used to split the contributed command, NOT the passed parameter values.
|
protected static AtomicInteger |
PIPE_COUNT |
Constructor and Description |
---|
ShellExecutor() |
Modifier and Type | Method and Description |
---|---|
ExecResult |
exec(CommandLineDescriptor cmdDesc,
CmdParameters params)
Deprecated.
|
ExecResult |
exec(CommandLineDescriptor cmdDesc,
CmdParameters params,
EnvironmentDescriptor env)
No exception is thrown but the returned
ExecResult contains everything about the command execution,
including an optional exception. |
protected ExecResult |
exec1(CommandLineDescriptor cmdDesc,
CmdParameters params,
EnvironmentDescriptor env) |
static String |
getCommandAbsolutePath(String command)
Returns the absolute path of a command looked up on the PATH
or the initial string if not found.
|
static Thread |
pipe(InputStream in,
OutputStream out)
Returns a started daemon thread piping bytes from the InputStream to the OutputStream.
|
static List<String> |
replaceParams(String word,
CmdParameters params)
Expands parameter strings in a parameter word.
|
protected static final AtomicInteger PIPE_COUNT
protected static final Pattern COMMAND_SPLIT
public ShellExecutor()
@Deprecated public ExecResult exec(CommandLineDescriptor cmdDesc, CmdParameters params)
Executor
ExecResult
contains everything about the command execution,
including an optional exception.public ExecResult exec(CommandLineDescriptor cmdDesc, CmdParameters params, EnvironmentDescriptor env)
Executor
ExecResult
contains everything about the command execution,
including an optional exception.protected ExecResult exec1(CommandLineDescriptor cmdDesc, CmdParameters params, EnvironmentDescriptor env) throws IOException
IOException
public static Thread pipe(InputStream in, OutputStream out)
The streams are both closed when the copy is finished.
public static List<String> replaceParams(String word, CmdParameters params)
This may return several words if the parameter value is marked as a list.
public static String getCommandAbsolutePath(String command)
Copyright © 2015 Nuxeo SA. All rights reserved.