Class CommandLineBuilder

java.lang.Object
org.eclipse.jetty.start.CommandLineBuilder

public class CommandLineBuilder extends Object
  • Constructor Details

    • CommandLineBuilder

      public CommandLineBuilder()
    • CommandLineBuilder

      @Deprecated public CommandLineBuilder(String bin)
      Deprecated.
    • CommandLineBuilder

      public CommandLineBuilder(boolean multiline)
  • Method Details

    • findExecutable

      public static File findExecutable(File root, String path)
    • findJavaBin

      public static String findJavaBin()
    • quote

      @Deprecated public static String quote(String arg)
      Parameters:
      arg - string
      Returns:
      Quoted string
    • shellQuoteIfNeeded

      public static String shellQuoteIfNeeded(String input)
      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

      public void addArg(String arg)
      Add a simple argument to the command line, quoted if necessary.
      Parameters:
      arg - the simple argument to add
    • addEqualsArg

      @Deprecated public void addEqualsArg(String name, String value)
      Deprecated.
    • addArg

      public void addArg(String name, String value)
      Add a "name=value" style argument to the command line with name and value quoted if necessary.
      Parameters:
      name - the name
      value - the value
    • addRawArg

      @Deprecated public void addRawArg(String arg)
      Deprecated.
    • addOption

      public void addOption(String option)
      Adds a "-OPTION" style option to the command line with no quoting, for example `--help`.
      Parameters:
      option - the option
    • addOption

      public void addOption(String option, String name, String value)
      Adds a "-OPTIONname=value" style option to the command line with name and value quoted if necessary, for example "-Dprop=value".
      Parameters:
      option - the option
      name - the name
      value - the value
    • getArgs

      public List<String> getArgs()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toQuotedString

      @Deprecated public String toQuotedString()
      Deprecated.
    • toCommandLine

      public String toCommandLine()
      A version of toString() 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()