|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.plexus.util.cli.shell.Shell
public class Shell
Class that abstracts the Shell functionality, with subclases for shells that behave particularly, like
command.com
cmd.exe
Constructor Summary | |
---|---|
Shell()
|
Method Summary | |
---|---|
void |
addShellArg(String arg)
|
void |
clearArguments()
|
Object |
clone()
|
protected String |
getArgumentEscapePattern()
|
protected char |
getArgumentQuoteDelimiter()
|
List<String> |
getCommandLine(String executable,
String[] arguments)
Get the command line for the provided executable and arguments in this shell |
protected char[] |
getEscapeChars(boolean includeSingleQuote,
boolean includeDoubleQuote)
|
String |
getExecutable()
|
protected char |
getExecutableQuoteDelimiter()
|
protected String |
getExecutionPreamble()
|
List<String> |
getOriginalCommandLine(String executable,
String[] arguments)
|
String |
getOriginalExecutable()
|
protected char[] |
getQuotingTriggerChars()
|
protected List<String> |
getRawCommandLine(String executable,
String[] arguments)
|
String[] |
getShellArgs()
Get the shell arguments |
List<String> |
getShellArgsList()
|
String |
getShellCommand()
Get the command to execute the shell |
List<String> |
getShellCommandLine(String[] arguments)
Get the full command line to execute, including shell command, shell arguments, executable and executable arguments |
File |
getWorkingDirectory()
|
String |
getWorkingDirectoryAsString()
|
protected boolean |
isDoubleQuotedArgumentEscaped()
|
protected boolean |
isDoubleQuotedExecutableEscaped()
|
boolean |
isQuotedArgumentsEnabled()
|
boolean |
isQuotedExecutableEnabled()
|
protected boolean |
isSingleQuotedArgumentEscaped()
|
protected boolean |
isSingleQuotedExecutableEscaped()
|
protected void |
setArgumentEscapePattern(String argumentEscapePattern)
|
protected void |
setArgumentQuoteDelimiter(char argQuoteDelimiter)
|
protected void |
setDoubleQuotedArgumentEscaped(boolean doubleQuotedArgumentEscaped)
|
protected void |
setDoubleQuotedExecutableEscaped(boolean doubleQuotedExecutableEscaped)
|
void |
setExecutable(String executable)
Sets the executable to run. |
protected void |
setExecutableQuoteDelimiter(char exeQuoteDelimiter)
|
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(File workingDir)
Sets execution directory. |
void |
setWorkingDirectory(String path)
Sets execution directory. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Shell()
Method Detail |
---|
public void setShellCommand(String shellCommand)
shellCommand
- public String getShellCommand()
public void setShellArgs(String[] shellArgs)
shellArgs
- public String[] getShellArgs()
public List<String> getCommandLine(String executable, String[] arguments)
executable
- executable that the shell has to callarguments
- arguments for the executable, not the shell
protected List<String> getRawCommandLine(String executable, String[] arguments)
protected char[] getQuotingTriggerChars()
protected String getExecutionPreamble()
protected char[] getEscapeChars(boolean includeSingleQuote, boolean includeDoubleQuote)
protected boolean isDoubleQuotedArgumentEscaped()
protected boolean isSingleQuotedArgumentEscaped()
protected boolean isDoubleQuotedExecutableEscaped()
protected boolean isSingleQuotedExecutableEscaped()
protected void setArgumentQuoteDelimiter(char argQuoteDelimiter)
protected char getArgumentQuoteDelimiter()
protected void setExecutableQuoteDelimiter(char exeQuoteDelimiter)
protected char getExecutableQuoteDelimiter()
protected void setArgumentEscapePattern(String argumentEscapePattern)
protected String getArgumentEscapePattern()
public List<String> getShellCommandLine(String[] arguments)
arguments
- arguments for the executable, not the shell
public List<String> getShellArgsList()
public void addShellArg(String arg)
public void setQuotedArgumentsEnabled(boolean quotedArgumentsEnabled)
public boolean isQuotedArgumentsEnabled()
public void setQuotedExecutableEnabled(boolean quotedExecutableEnabled)
public boolean isQuotedExecutableEnabled()
public void setExecutable(String executable)
public String getExecutable()
public void setWorkingDirectory(String path)
public void setWorkingDirectory(File workingDir)
public File getWorkingDirectory()
public String getWorkingDirectoryAsString()
public void clearArguments()
public Object clone()
clone
in class Object
public String getOriginalExecutable()
public List<String> getOriginalCommandLine(String executable, String[] arguments)
protected void setDoubleQuotedArgumentEscaped(boolean doubleQuotedArgumentEscaped)
protected void setDoubleQuotedExecutableEscaped(boolean doubleQuotedExecutableEscaped)
protected void setSingleQuotedArgumentEscaped(boolean singleQuotedArgumentEscaped)
protected void setSingleQuotedExecutableEscaped(boolean singleQuotedExecutableEscaped)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |