Class CommandLine

java.lang.Object
org.openqa.selenium.os.CommandLine

public class CommandLine extends Object
  • Constructor Details

    • CommandLine

      public CommandLine(String executable, String... args)
  • Method Details

    • setEnvironmentVariables

      public void setEnvironmentVariables(Map<String,String> environment)
      Adds the specified environment variables.
      Parameters:
      environment - the variables to add
      Throws:
      IllegalArgumentException - if any value given is null (unsupported)
    • setEnvironmentVariable

      public void setEnvironmentVariable(String name, String value)
      Adds the specified environment variable.
      Parameters:
      name - the name of the environment variable
      value - the value of the environment variable
      Throws:
      IllegalArgumentException - if the value given is null (unsupported)
    • setDynamicLibraryPath

      public void setDynamicLibraryPath(String newLibraryPath)
    • updateDynamicLibraryPath

      public void updateDynamicLibraryPath(String extraPath)
    • getLibraryPathPropertyName

      public static String getLibraryPathPropertyName()
      Returns:
      The platform specific env property name which contains the library path.
    • executeAsync

      public void executeAsync()
    • execute

      public void execute()
    • waitForProcessStarted

      public boolean waitForProcessStarted(long duration, TimeUnit unit)
    • waitFor

      public void waitFor()
    • waitFor

      public void waitFor(long timeout)
    • isSuccessful

      public boolean isSuccessful()
    • getExitCode

      public int getExitCode()
    • getStdOut

      public String getStdOut()
    • destroy

      public int destroy()
      Destroy the current command.
      Returns:
      The exit code of the command.
    • isRunning

      public boolean isRunning()
      Check whether the current command is still executing.
      Returns:
      true if the current command is still executing, false otherwise
    • setInput

      public void setInput(String allInput)
    • setWorkingDirectory

      public void setWorkingDirectory(String workingDirectory)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • copyOutputTo

      public void copyOutputTo(OutputStream out)
    • checkForError

      public void checkForError()