Class CmdRunner

java.lang.Object
org.openjump.core.ui.plugin.customize.CmdRunner

public class CmdRunner extends Object
Author:
Larry Becker This class launches exernal programs with command line options. Stack traces are printed when exceptions occur.
  • Constructor Details

    • CmdRunner

      public CmdRunner()
  • Method Details

    • run

      public void run(String[] runStr, boolean runAndWait)
      Essentialy a wrapper for Runtime.getRuntime().exec() that waits and catches exceptions.
      Parameters:
      runStr - a command and its parameters
      runAndWait - True - wait for process to end, False - do not wait for process to end
    • addEnviroment

      public static void addEnviroment(String enviromentVariable, String value)
    • runLater

      public void runLater(String commandLine, char delimiter)
      Run command line and do not wait for process to end
      Parameters:
      commandLine - - command to run - must be executable at system command line.
      delimiter - - character used to delimit parameters - must not occur inside parameters.
    • run

      public void run(String commandLine, char delimiter)
      Run command line, wait and catch exceptions
      Parameters:
      commandLine - - command to run - must be executable at system command line.
      delimiter - - character used to delimit parameters - must not occur inside parameters.
    • runAndGetOutput

      public String[] runAndGetOutput(String command, char delimiter)
      Parameters:
      command - - (full) command to run - must be executable at system command line.
      delimiter - - character used to delimit parameters - must not occur inside parameters.
      Returns:
      output of commmand or null if no ouput produced.
    • getOsName

      public static String getOsName()
    • isWindows

      public static boolean isWindows()