public class DefaultCommandLine extends Object implements CommandLine
| Modifier and Type | Method and Description |
|---|---|
CommandLine |
add(boolean quote,
Object... arguments)
Adds the specified command line arguments.
|
CommandLine |
add(boolean quote,
Object argument)
Adds the specified command line argument.
|
CommandLine |
add(Object... arguments)
Adds the specified command line arguments.
|
CommandLine |
add(Object argument)
Adds the specified command line argument.
|
CommandLine |
addSub(String name,
Object value)
Adds a variable substitution for the arguments.
|
static CommandLine |
createCommandLine(File executable) |
static CommandLine |
createCommandLine(String executable) |
List<String> |
getArguments()
Returns the arguments.
|
List<String> |
getCommand()
Returns the of the command list.
|
String |
getExecutable()
Returns the executable.
|
File |
getWorkingDir()
Returns the working directory.
|
void |
setVariableStartChar(char character)
Sets the variable substitution start character.
|
void |
setVariableStopChar(char character)
Sets the variable substitution stop character.
|
void |
setWorkingDir(File dir)
Sets the working directory.
|
String |
toString() |
public static CommandLine createCommandLine(File executable)
public static CommandLine createCommandLine(String executable)
public List<String> getCommand()
CommandLinegetCommand in interface CommandLineList of String that contains the
executable as the first item and the command arguments as the
rest.public String getExecutable()
CommandLinegetExecutable in interface CommandLineObject executable to run, can be the name of the
executable or the path or any other abstract object.public List<String> getArguments()
CommandLinegetArguments in interface CommandLineList of arguments.public CommandLine add(Object... arguments)
CommandLineadd in interface CommandLinearguments - the Object array arguments.DefaultCommandLine.public CommandLine add(boolean quote, Object... arguments)
CommandLineadd in interface CommandLinequote - set to true to quote the argument.arguments - the Object array arguments.DefaultCommandLine.public CommandLine add(Object argument)
CommandLineadd in interface CommandLineDefaultCommandLine.public CommandLine add(boolean quote, Object argument)
CommandLineIf the quote arguments is set then the arguments is quoted in double/single quotes.
aaa -> aaaaaa bbb -> "aaa bbb""aaa" bbb -> '"aaa" bbb'"aaa ccc" bbb -> '"aaa ccc" bbb'"aaa"bbb -> '"aaa"bbb'add in interface CommandLinequote - set to true to quote the argument.argument - the Object argument.DefaultCommandLine.public CommandLine addSub(String name, Object value)
CommandLine"<", ">", for example:
"foo=<bar>".addSub in interface CommandLinename - the String name of the variable.value - the Object value of the variable.DefaultCommandLine.public void setWorkingDir(File dir)
CommandLinesetWorkingDir in interface CommandLinedir - the File directory or null to use the working
directory of the current Java process.public File getWorkingDir()
CommandLinegetWorkingDir in interface CommandLineFile directory or null to use the working
directory of the current Java process.public void setVariableStartChar(char character)
CommandLine"<".setVariableStartChar in interface CommandLinecharacter - the character.public void setVariableStopChar(char character)
CommandLine">".setVariableStopChar in interface CommandLinecharacter - the character.public String toString()
toString in interface CommandLinetoString in class ObjectCopyright © 2014. All rights reserved.