Class JarCommandLine

java.lang.Object
org.apache.commons.exec.CommandLine
org.wildfly.qa.tooling.processexecution.JarCommandLine

public class JarCommandLine extends org.apache.commons.exec.CommandLine
CommandLine abstraction for executing JAR files. This class provides a convenient way to create a CommandLine for running JAR files with proper validation and java binary resolution.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new JarCommandLine with default java binary from java.home system property.
    JarCommandLine(Path javaBinary, Path jar)
    Create a new JarCommandLine with custom java binary and JAR file.
  • Method Summary

    Methods inherited from class org.apache.commons.exec.CommandLine

    addArgument, addArgument, addArguments, addArguments, addArguments, addArguments, getArguments, getExecutable, getSubstitutionMap, isFile, parse, parse, setSubstitutionMap, toString, toStrings

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • JarCommandLine

      public JarCommandLine(Path javaBinary, Path jar)
      Create a new JarCommandLine with custom java binary and JAR file.
      Parameters:
      javaBinary - path to the java binary to use
      jar - path to the JAR file to execute
      Throws:
      IllegalArgumentException - if javaBinary or jar doesn't exist or is not a regular file
    • JarCommandLine

      public JarCommandLine(Path jar)
      Create a new JarCommandLine with default java binary from java.home system property.
      Parameters:
      jar - path to the JAR file to execute
      Throws:
      IllegalArgumentException - if jar doesn't exist or is not a regular file