Package org.bgerp.util

# Class RuntimeRunner

java.lang.Object
org.bgerp.util.RuntimeRunner

public class RuntimeRunner extends Object
Runner of OS commands, logging STDOUT and STDERR outputs with levels INFO and ERROR respectively and collecting those.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RuntimeRunner(String... commands)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `RuntimeRunner`
  `directory(File value)`
  Working directory
  `RuntimeRunner`
  `run()`
  Execute OS commands
  `int`
  `runSafe()`
  Execute OS commands
  `List<String>`
  `stdErr()`
  `List<String>`
  `stdOut()`

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

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

- ## Constructor Details

  - ### RuntimeRunner

    public RuntimeRunner(String... commands)

- ## Method Details

  - ### directory

    public RuntimeRunner directory(File value)
    Working directory
    Parameters:
      `value` - the directory
    Returns:
      the runner

  - ### stdErr

    public List<String> stdErr()
    Returns:
      lines of STDERR

  - ### stdOut

    public List<String> stdOut()
    Returns:
      lines of STDOUT

  - ### run

    public RuntimeRunner run() throws IOException, InterruptedException
    Execute OS commands
    Returns:
      the runner
    Throws:
      `IOException`
      `InterruptedException`
      `BGException` - if exit code wasn't 0

  - ### runSafe

    public int runSafe() throws IOException, InterruptedException
    Execute OS commands
    Returns:
      the exit code
    Throws:
      `IOException`
      `InterruptedException`