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
Constructor and Description |
---|
Shell() |
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
String |
getExecutable() |
List<String> |
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 |
isSingleQuotedArgumentEscaped() |
boolean |
isUnconditionalQuoting() |
protected String |
quoteOneItem(String inputString,
boolean isExecutable) |
void |
setExecutable(String executable)
Sets the executable to run.
|
void |
setQuotedArgumentsEnabled(boolean quotedArgumentsEnabled) |
void |
setUnconditionalQuoting(boolean unconditionalQuoting) |
void |
setWorkingDirectory(File workingDir)
Sets execution directory.
|
void |
setWorkingDirectory(String path)
Sets execution directory.
|
protected boolean isDoubleQuotedArgumentEscaped()
protected boolean isSingleQuotedArgumentEscaped()
public List<String> getShellCommandLine(String... arguments)
arguments
- arguments for the executable, not the shellpublic void setQuotedArgumentsEnabled(boolean quotedArgumentsEnabled)
public void setExecutable(String executable)
public String getExecutable()
public void setWorkingDirectory(String path)
public void setWorkingDirectory(File workingDir)
public File getWorkingDirectory()
public boolean isUnconditionalQuoting()
public void setUnconditionalQuoting(boolean unconditionalQuoting)
Copyright © 2022. All rights reserved.