|
||||||||||
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(java.lang.String arg)
|
void |
clearArguments()
|
java.lang.Object |
clone()
|
protected char |
getArgumentQuoteDelimiter()
|
java.util.List |
getCommandLine(java.lang.String executable,
java.lang.String[] arguments)
Get the command line for the provided executable and arguments in this shell |
protected char[] |
getEscapeChars(boolean includeSingleQuote,
boolean includeDoubleQuote)
|
java.lang.String |
getExecutable()
|
protected char |
getExecutableQuoteDelimiter()
|
protected java.lang.String |
getExecutionPreamble()
|
java.util.List |
getOriginalCommandLine(java.lang.String executable,
java.lang.String[] arguments)
|
java.lang.String |
getOriginalExecutable()
|
protected char[] |
getQuotingTriggerChars()
|
protected java.util.List |
getRawCommandLine(java.lang.String executable,
java.lang.String[] arguments)
|
java.lang.String[] |
getShellArgs()
Get the shell arguments |
java.util.List |
getShellArgsList()
|
java.lang.String |
getShellCommand()
Get the command to execute the shell |
java.util.List |
getShellCommandLine(java.lang.String[] arguments)
Get the full command line to execute, including shell command, shell arguments, executable and executable arguments |
java.io.File |
getWorkingDirectory()
|
java.lang.String |
getWorkingDirectoryAsString()
|
protected boolean |
isDoubleQuotedArgumentEscaped()
|
protected boolean |
isDoubleQuotedExecutableEscaped()
|
boolean |
isQuotedArgumentsEnabled()
|
boolean |
isQuotedExecutableEnabled()
|
protected boolean |
isSingleQuotedArgumentEscaped()
|
protected boolean |
isSingleQuotedExecutableEscaped()
|
protected void |
setArgumentQuoteDelimiter(char argQuoteDelimiter)
|
protected void |
setDoubleQuotedArgumentEscaped(boolean doubleQuotedArgumentEscaped)
|
protected void |
setDoubleQuotedExecutableEscaped(boolean doubleQuotedExecutableEscaped)
|
void |
setExecutable(java.lang.String executable)
Sets the executable to run. |
protected void |
setExecutableQuoteDelimiter(char exeQuoteDelimiter)
|
void |
setQuotedArgumentsEnabled(boolean quotedArgumentsEnabled)
|
void |
setQuotedExecutableEnabled(boolean quotedExecutableEnabled)
|
void |
setShellArgs(java.lang.String[] shellArgs)
Set the shell arguments when calling a command line (not the executable arguments) (eg. |
void |
setShellCommand(java.lang.String shellCommand)
Set the command to execute the shell (eg. |
protected void |
setSingleQuotedArgumentEscaped(boolean singleQuotedArgumentEscaped)
|
protected void |
setSingleQuotedExecutableEscaped(boolean singleQuotedExecutableEscaped)
|
void |
setWorkingDirectory(java.io.File workingDir)
Sets execution directory. |
void |
setWorkingDirectory(java.lang.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(java.lang.String shellCommand)
shellCommand
- public java.lang.String getShellCommand()
public void setShellArgs(java.lang.String[] shellArgs)
shellArgs
- public java.lang.String[] getShellArgs()
public java.util.List getCommandLine(java.lang.String executable, java.lang.String[] arguments)
executable
- executable that the shell has to callarguments
- arguments for the executable, not the shell
protected java.util.List getRawCommandLine(java.lang.String executable, java.lang.String[] arguments)
protected char[] getQuotingTriggerChars()
protected java.lang.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()
public java.util.List getShellCommandLine(java.lang.String[] arguments)
arguments
- arguments for the executable, not the shell
public java.util.List getShellArgsList()
public void addShellArg(java.lang.String arg)
public void setQuotedArgumentsEnabled(boolean quotedArgumentsEnabled)
public boolean isQuotedArgumentsEnabled()
public void setQuotedExecutableEnabled(boolean quotedExecutableEnabled)
public boolean isQuotedExecutableEnabled()
public void setExecutable(java.lang.String executable)
public java.lang.String getExecutable()
public void setWorkingDirectory(java.lang.String path)
public void setWorkingDirectory(java.io.File workingDir)
public java.io.File getWorkingDirectory()
public java.lang.String getWorkingDirectoryAsString()
public void clearArguments()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getOriginalExecutable()
public java.util.List getOriginalCommandLine(java.lang.String executable, java.lang.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 |