Package org.eclipse.jetty.start
Class CommandLineBuilder
java.lang.Object
org.eclipse.jetty.start.CommandLineBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a simple argument to the command line, quoted if necessary.void
Add a "name=value" style argument to the command line with name and value quoted if necessary.void
Adds a "-OPTION" style option to the command line with no quoting, for example `--help`.void
Adds a "-OPTIONname=value" style option to the command line with name and value quoted if necessary, for example "-Dprop=value".void
debug()
static String
getArgs()
static String
shellQuoteIfNeeded
(String input) This method applies single quotes suitable for a POSIX compliant shell if necessary.A version oftoString()
where every arg is evaluated for potential'
(single-quote tick) wrapping.toString()
-
Constructor Details
-
CommandLineBuilder
public CommandLineBuilder() -
CommandLineBuilder
public CommandLineBuilder(boolean multiline)
-
-
Method Details
-
findJavaBin
-
shellQuoteIfNeeded
This method applies single quotes suitable for a POSIX compliant shell if necessary.- Parameters:
input
- The string to quote if needed- Returns:
- The quoted string or the original string if quotes are not necessary
-
addArg
Add a simple argument to the command line, quoted if necessary.- Parameters:
arg
- the simple argument to add
-
addArg
Add a "name=value" style argument to the command line with name and value quoted if necessary.- Parameters:
name
- the namevalue
- the value
-
addOption
Adds a "-OPTION" style option to the command line with no quoting, for example `--help`.- Parameters:
option
- the option
-
addOption
Adds a "-OPTIONname=value" style option to the command line with name and value quoted if necessary, for example "-Dprop=value".- Parameters:
option
- the optionname
- the namevalue
- the value
-
getArgs
-
toString
-
toCommandLine
A version oftoString()
where every arg is evaluated for potential'
(single-quote tick) wrapping.- Returns:
- the toString but each arg that has spaces is surrounded by
'
(single-quote tick)
-
debug
public void debug()
-