org.codehaus.plexus.util.cli.shell
public class Shell extends Object implements Cloneable
Class that abstracts the Shell functionality, with subclases for shells that behave particularly, like
command.com
cmd.exe
Since: 1.2
Version: $Id: Shell.java 5960 2007-02-28 22:35:43Z jdcasey $
Field Summary | |
---|---|
boolean | doubleQuotedArgumentEscaped |
boolean | doubleQuotedExecutableEscaped |
String | executable |
boolean | quotedArgumentsEnabled |
boolean | quotedExecutableEnabled |
List | shellArgs |
String | shellCommand |
boolean | singleQuotedArgumentEscaped |
boolean | singleQuotedExecutableEscaped |
File | workingDir |
Method Summary | |
---|---|
void | addShellArg(String arg) |
void | clearArguments() |
Object | clone() |
List | getCommandLine(String executable, String[] arguments)
Get the command line for the provided executable and arguments in this shell
|
String | getExecutable() |
List | getOriginalCommandLine(String executable, String[] arguments) |
String | getOriginalExecutable() |
List | getRawCommandLine(String executable, String[] arguments) |
String[] | getShellArgs()
Get the shell arguments
|
List | getShellArgsList() |
String | getShellCommand()
Get the command to execute the shell
|
List | getShellCommandLine(String[] arguments)
Get the full command line to execute, including shell command, shell arguments,
executable and executable arguments
|
File | getWorkingDirectory() |
protected boolean | isDoubleQuotedArgumentEscaped() |
protected boolean | isDoubleQuotedExecutableEscaped() |
boolean | isQuotedArgumentsEnabled() |
boolean | isQuotedExecutableEnabled() |
protected boolean | isSingleQuotedArgumentEscaped() |
protected boolean | isSingleQuotedExecutableEscaped() |
protected void | setDoubleQuotedArgumentEscaped(boolean doubleQuotedArgumentEscaped) |
protected void | setDoubleQuotedExecutableEscaped(boolean doubleQuotedExecutableEscaped) |
void | setExecutable(String executable)
Sets the executable to run. |
void | setQuotedArgumentsEnabled(boolean quotedArgumentsEnabled) |
void | setQuotedExecutableEnabled(boolean quotedExecutableEnabled) |
void | setShellArgs(String[] shellArgs)
Set the shell arguments when calling a command line (not the executable arguments)
(eg. |
void | setShellCommand(String shellCommand)
Set the command to execute the shell (eg. |
protected void | setSingleQuotedArgumentEscaped(boolean singleQuotedArgumentEscaped) |
protected void | setSingleQuotedExecutableEscaped(boolean singleQuotedExecutableEscaped) |
void | setWorkingDirectory(String path)
Sets execution directory. |
void | setWorkingDirectory(File workingDir)
Sets execution directory. |
Parameters: executable executable that the shell has to call arguments arguments for the executable, not the shell
Returns: List with one String object with executable and arguments quoted as needed
Returns:
Returns:
Parameters: arguments arguments for the executable, not the shell
Returns: List of String objects, whose array version is suitable to be used as argument of Runtime.getRuntime().exec()
Parameters: shellArgs
Parameters: shellCommand