public static class Shell.ShellCommandExecutor extends Shell
ShellCommandExecutor
should be used in cases where the output
of the command needs no explicit parsing and where the command, working
directory and the environment remains unchanged. The output of the command
is stored as-is and is expected to be small.Shell.ExitCodeException, Shell.ShellCommandExecutor
LOG, SET_GROUP_COMMAND, SET_OWNER_COMMAND, SET_PERMISSION_COMMAND, USER_NAME_COMMAND, WINDOWS
Constructor and Description |
---|
ShellCommandExecutor(String[] execString) |
ShellCommandExecutor(String[] execString,
File dir) |
ShellCommandExecutor(String[] execString,
File dir,
Map<String,String> env) |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Execute the shell command.
|
protected String[] |
getExecString()
return an array containing the command name & its parameters
|
String |
getOutput()
Get the output of the shell command.
|
protected void |
parseExecResult(BufferedReader lines)
Parse the execution result
|
String |
toString()
Returns the commands of this instance.
|
execCommand, execCommand, getExitCode, getGET_PERMISSION_COMMAND, getGROUPS_COMMAND, getProcess, getUlimitMemoryCommand, run, setEnvironment, setWorkingDirectory
public ShellCommandExecutor(String[] execString)
public void execute() throws IOException
IOException
protected String[] getExecString()
Shell
getExecString
in class Shell
protected void parseExecResult(BufferedReader lines) throws IOException
Shell
parseExecResult
in class Shell
IOException
public String getOutput()
Copyright © 2010 The Apache Software Foundation