|
||||||||||
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
Field Summary | |
---|---|
private boolean |
doubleQuotedArgumentEscaped
|
private boolean |
doubleQuotedExecutableEscaped
|
private java.lang.String |
executable
|
private boolean |
quotedArgumentsEnabled
|
private boolean |
quotedExecutableEnabled
|
private java.util.List |
shellArgs
|
private java.lang.String |
shellCommand
|
private boolean |
singleQuotedArgumentEscaped
|
private boolean |
singleQuotedExecutableEscaped
|
private java.io.File |
workingDir
|
Constructor Summary | |
---|---|
Shell()
|
Method Summary | |
---|---|
void |
addShellArg(java.lang.String arg)
|
void |
clearArguments()
|
java.lang.Object |
clone()
|
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 |
java.lang.String |
getExecutable()
|
java.util.List |
getOriginalCommandLine(java.lang.String executable,
java.lang.String[] arguments)
|
java.lang.String |
getOriginalExecutable()
|
private 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()
|
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(java.lang.String executable)
Sets the executable to run. |
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 |
Field Detail |
---|
private java.lang.String shellCommand
private java.util.List shellArgs
private boolean quotedArgumentsEnabled
private java.lang.String executable
private java.io.File workingDir
private boolean quotedExecutableEnabled
private boolean doubleQuotedArgumentEscaped
private boolean singleQuotedArgumentEscaped
private boolean doubleQuotedExecutableEscaped
private boolean singleQuotedExecutableEscaped
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
private java.util.List getRawCommandLine(java.lang.String executable, java.lang.String[] arguments)
protected boolean isDoubleQuotedArgumentEscaped()
protected boolean isSingleQuotedArgumentEscaped()
protected boolean isDoubleQuotedExecutableEscaped()
protected boolean isSingleQuotedExecutableEscaped()
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 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 |