public class CommandLine
extends java.lang.Object
Constructor and Description |
---|
CommandLine(CommandLine other)
Copy constructor.
|
CommandLine(java.io.File executable)
Create a command line without any arguments.
|
CommandLine(java.lang.String executable)
Create a command line without any arguments.
|
Modifier and Type | Method and Description |
---|---|
CommandLine |
addArgument(java.lang.String argument)
Add a single argument.
|
CommandLine |
addArgument(java.lang.String argument,
boolean handleQuoting)
Add a single argument.
|
CommandLine |
addArguments(java.lang.String addArguments)
Add multiple arguments.
|
CommandLine |
addArguments(java.lang.String[] addArguments)
Add multiple arguments.
|
CommandLine |
addArguments(java.lang.String[] addArguments,
boolean handleQuoting)
Add multiple arguments.
|
CommandLine |
addArguments(java.lang.String addArguments,
boolean handleQuoting)
Add multiple arguments.
|
java.lang.String[] |
getArguments()
Returns the expanded and quoted command line arguments.
|
java.lang.String |
getExecutable()
Returns the executable.
|
java.util.Map<java.lang.String,?> |
getSubstitutionMap() |
boolean |
isFile()
Was a file being used to set the executable?
|
static CommandLine |
parse(java.lang.String line)
Create a command line from a string.
|
static CommandLine |
parse(java.lang.String line,
java.util.Map<java.lang.String,?> substitutionMap)
Create a command line from a string.
|
void |
setSubstitutionMap(java.util.Map<java.lang.String,?> substitutionMap)
Set the substitutionMap to expand variables in the
command line.
|
java.lang.String |
toString()
Stringify operator returns the command line as a string.
|
java.lang.String[] |
toStrings()
Returns the command line as an array of strings.
|
public CommandLine(java.lang.String executable)
executable
- the executablepublic CommandLine(java.io.File executable)
executable
- the executable filepublic CommandLine(CommandLine other)
other
- the instance to copypublic static CommandLine parse(java.lang.String line)
line
- the first element becomes the executable, the rest the argumentsjava.lang.IllegalArgumentException
- If line is null or all whitespacepublic static CommandLine parse(java.lang.String line, java.util.Map<java.lang.String,?> substitutionMap)
line
- the first element becomes the executable, the rest the argumentssubstitutionMap
- the name/value pairs used for substitutionjava.lang.IllegalArgumentException
- If line is null or all whitespacepublic java.lang.String getExecutable()
public boolean isFile()
public CommandLine addArguments(java.lang.String[] addArguments)
addArguments
- An array of argumentspublic CommandLine addArguments(java.lang.String[] addArguments, boolean handleQuoting)
addArguments
- An array of argumentshandleQuoting
- Add the argument with/without handling quotingpublic CommandLine addArguments(java.lang.String addArguments)
addArguments
- An string containing multiple arguments.public CommandLine addArguments(java.lang.String addArguments, boolean handleQuoting)
addArguments
- An string containing multiple arguments.handleQuoting
- Add the argument with/without handling quotingpublic CommandLine addArgument(java.lang.String argument)
argument
- The argument to addjava.lang.IllegalArgumentException
- If argument contains both single and double quotespublic CommandLine addArgument(java.lang.String argument, boolean handleQuoting)
argument
- The argument to addhandleQuoting
- Add the argument with/without handling quotingpublic java.lang.String[] getArguments()
public java.util.Map<java.lang.String,?> getSubstitutionMap()
public void setSubstitutionMap(java.util.Map<java.lang.String,?> substitutionMap)
substitutionMap
- the mappublic java.lang.String[] toStrings()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved