Package org.eclipse.rdf4j.common.platform

## Class ProcessLauncher

- java.lang.Object
- - org.eclipse.rdf4j.common.platform.ProcessLauncher

-     @Deprecated
      public final class ProcessLauncher
      extends Object

  Deprecated.
  Launches a process, redirecting the output of that sub-process to the output of this (the parent) process.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `ProcessLauncher.CommandNotExistsException` | Deprecated. Exception that is thrown when a command could not be executed because it (probably) does not exist at all.
    `static interface` | `ProcessLauncher.OutputListener` | Deprecated. Classes implementing this interface can receive output generated by processes launched using the ProcessLauncher.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ProcessLauncher​(String commandLine)` | Deprecated. Constructs a new ProcessLauncher with the given command line.
    `ProcessLauncher​(String[] commandArray)` | Deprecated. Constructs a new ProcessLauncher with the given command array.
    `ProcessLauncher​(String[] commandArray, File baseDir)` | Deprecated. Constructs a new ProcessLauncher with the given command array and base directory.
    `ProcessLauncher​(String commandLine, File baseDir)` | Deprecated. Constructs a new ProcessLauncher with the given command line and base directory
    `ProcessLauncher​(ArrayList<?> commandList)` | Deprecated. Constructs new process launcher with the given command element list.
    `ProcessLauncher​(ArrayList<?> commandList, File baseDir)` | Deprecated. Constructs new process launcher with the given command element list and base directory.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `abort()` | Deprecated. Tries to abort the currently running process.
    `void` | `addOutputListener​(ProcessLauncher.OutputListener listener)` | Deprecated. Add a listener for output from the to-be-launched process.
    `String` | `getCommandLine()` | Deprecated. Get the commandline that is used to launch the process.
    `String` | `getErrorOutput()` | Deprecated. Get error output, in case no listeners were registered - never returns null.
    `String` | `getStandardOutput()` | Deprecated. Get standard output, in case no listeners were registered - never returns null.
    `boolean` | `hasFinished()` | Deprecated. Check whether execution has finished.
    `int` | `launch()` | Deprecated. Launches the process, and blocks until that process completes execution.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProcessLauncher

          public ProcessLauncher​(String commandLine)

      Deprecated.
      Constructs a new ProcessLauncher with the given command line.
      Parameters:
        `commandLine` - command line

    - #### ProcessLauncher

          public ProcessLauncher​(String commandLine,
                                 File baseDir)

      Deprecated.
      Constructs a new ProcessLauncher with the given command line and base directory
      Parameters:
        `commandLine` - command line
        `baseDir` - base directory

    - #### ProcessLauncher

          public ProcessLauncher​(String[] commandArray)

      Deprecated.
      Constructs a new ProcessLauncher with the given command array.
      Parameters:
        `commandArray` - command as array of strings

    - #### ProcessLauncher

          public ProcessLauncher​(String[] commandArray,
                                 File baseDir)

      Deprecated.
      Constructs a new ProcessLauncher with the given command array and base directory.
      Parameters:
        `commandArray` - command as array of strings
        `baseDir` - base directory

    - #### ProcessLauncher

          public ProcessLauncher​(ArrayList<?> commandList)

      Deprecated.
      Constructs new process launcher with the given command element list.
      Parameters:
        `commandList` - command list

    - #### ProcessLauncher

          public ProcessLauncher​(ArrayList<?> commandList,
                                 File baseDir)

      Deprecated.
      Constructs new process launcher with the given command element list and base directory.
      Parameters:
        `commandList` - command list
        `baseDir` - base directory

  - ### Method Detail

    - #### addOutputListener

          public void addOutputListener​(ProcessLauncher.OutputListener listener)

      Deprecated.
      Add a listener for output from the to-be-launched process.
      Parameters:
        `listener` - output listener

    - #### getStandardOutput

          public String getStandardOutput()

      Deprecated.
      Get standard output, in case no listeners were registered - never returns null.
      Returns:
        standard output as string

    - #### getErrorOutput

          public String getErrorOutput()

      Deprecated.
      Get error output, in case no listeners were registered - never returns null.
      Returns:
        standard error as string

    - #### getCommandLine

          public String getCommandLine()

      Deprecated.
      Get the commandline that is used to launch the process.
      Returns:
        command line

    - #### hasFinished

          public boolean hasFinished()

      Deprecated.
      Check whether execution has finished.
      Returns:
        true when finished

    - #### launch

          public int launch()
                     throws ProcessLauncher.CommandNotExistsException

      Deprecated.
      Launches the process, and blocks until that process completes execution.
      Returns:
        command exit value
      Throws:
        `ProcessLauncher.CommandNotExistsException` - If the command could not be executed because it does not exist

    - #### abort

          public void abort()

      Deprecated.
      Tries to abort the currently running process.