public interface 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.
|
List<String> |
getArguments()
Returns the arguments.
|
List<String> |
getCommand()
Returns the of the command list.
|
Object |
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() |
List<String> getCommand() throws CommandExecException
List of String that contains the
executable as the first item and the command arguments as the
rest.CommandExecException - if there was an error create the command.Object getExecutable()
Object executable to run, can be the name of the
executable or the path or any other abstract object.List<String> getArguments()
List of arguments.CommandLine add(Object... arguments)
arguments - the Object array arguments.DefaultCommandLine.CommandLine add(boolean quote, Object... arguments)
quote - set to true to quote the argument.arguments - the Object array arguments.DefaultCommandLine.CommandLine add(Object argument)
arguments - the Object argument.DefaultCommandLine.CommandLine add(boolean quote, Object argument)
If 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'argument - the Object argument.quote - set to true to quote the argument.DefaultCommandLine.CommandLine addSub(String name, Object value)
"<", ">", for example:
"foo=<bar>".name - the String name of the variable.value - the Object value of the variable.DefaultCommandLine.void setWorkingDir(File dir)
dir - the File directory or null to use the working
directory of the current Java process.File getWorkingDir()
File directory or null to use the working
directory of the current Java process.void setVariableStartChar(char character)
"<".character - the character.void setVariableStopChar(char character)
">".character - the character.Copyright © 2014–2015. All rights reserved.