Class CommandLine

java.lang.Object
com.sun.enterprise.admin.launcher.CommandLine
All Implemented Interfaces:
Iterable<String>

public final class CommandLine extends Object implements Iterable<String>
Universal command line for launching the GlassFish reliably in all scenarios.
  • Constructor Details

    • CommandLine

      public CommandLine(com.sun.enterprise.admin.launcher.CommandLine.CommandFormat format)
      Parameters:
      format - BAT files use specific format compared to command line.
  • Method Details

    • getFormat

      public com.sun.enterprise.admin.launcher.CommandLine.CommandFormat getFormat()
      Returns:
      CommandLine.CommandFormat
    • append

      public void append(String item)
      Appends new item without any formatting.
      Parameters:
      item -
    • appendClassPath

      public void appendClassPath(File... paths)
      Appends classpath argument (whole -cp [paths])
      Parameters:
      paths -
    • appendNativeLibraryPath

      public void appendNativeLibraryPath(File... paths)
      Appends java system option "java.library.path". The value will be wrapped into quotation marks.
      Parameters:
      paths -
    • append

      public void append(Path path)
      Appends path, normalized, absolute and quoted if needed.
      Parameters:
      path -
    • appendJavaOption

      public void appendJavaOption(String item)
      Appends java option without any changes.
      Parameters:
      item -
    • appendJavaOption

      public void appendJavaOption(String itemKey, Path path)
      Appends java option. The path will be wrapped into quotation marks.
      Parameters:
      itemKey -
      path -
    • appendSystemOption

      public void appendSystemOption(String itemKey, String itemValue)
      Appends java system option. The value will be wrapped into quotation marks.
      Parameters:
      itemKey -
      itemValue -
    • iterator

      public Iterator<String> iterator()
      Specified by:
      iterator in interface Iterable<String>
    • listIterator

      public ListIterator<String> listIterator()
      Returns:
      ListIterator
    • toString

      public String toString()
      Generates the final command using an empty space as a separator.
      Overrides:
      toString in class Object
    • toString

      public String toString(String separator)
      Generates the final command using given separator.
      Parameters:
      separator -
      Returns:
      the command as a string
    • toList

      public List<String> toList()
      Converts the object to an unmodifiable list of elements.
      Returns:
      list of strings