Package org.openqa.selenium.os
Class CommandLine
- java.lang.Object
-
- org.openqa.selenium.os.CommandLine
-
public class CommandLine extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CommandLine(java.lang.String[] cmdarray)
CommandLine(java.lang.String executable, java.lang.String... args)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkForError()
void
copyOutputTo(java.io.OutputStream out)
int
destroy()
Destroy the current command.void
execute()
void
executeAsync()
int
getExitCode()
static java.lang.String
getLibraryPathPropertyName()
java.lang.String
getStdOut()
boolean
isRunning()
Check whether the current command is still executing.boolean
isSuccessful()
void
setDynamicLibraryPath(java.lang.String newLibraryPath)
void
setEnvironmentVariable(java.lang.String name, java.lang.String value)
Adds the specified environment variable.void
setEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> environment)
Adds the specified environment variables.void
setInput(java.lang.String allInput)
void
setWorkingDirectory(java.lang.String workingDirectory)
java.lang.String
toString()
void
updateDynamicLibraryPath(java.lang.String extraPath)
void
waitFor()
void
waitFor(long timeout)
-
-
-
Method Detail
-
setEnvironmentVariables
public void setEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> environment)
Adds the specified environment variables.- Parameters:
environment
- the variables to add- Throws:
java.lang.IllegalArgumentException
- if any value given is null (unsupported)
-
setEnvironmentVariable
public void setEnvironmentVariable(java.lang.String name, java.lang.String value)
Adds the specified environment variable.- Parameters:
name
- the name of the environment variablevalue
- the value of the environment variable- Throws:
java.lang.IllegalArgumentException
- if the value given is null (unsupported)
-
setDynamicLibraryPath
public void setDynamicLibraryPath(java.lang.String newLibraryPath)
-
updateDynamicLibraryPath
public void updateDynamicLibraryPath(java.lang.String extraPath)
-
getLibraryPathPropertyName
public static java.lang.String getLibraryPathPropertyName()
- Returns:
- The platform specific env property name which contains the library path.
-
executeAsync
public void executeAsync()
-
execute
public void execute()
-
waitFor
public void waitFor()
-
waitFor
public void waitFor(long timeout)
-
isSuccessful
public boolean isSuccessful()
-
getExitCode
public int getExitCode()
-
getStdOut
public java.lang.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(java.lang.String allInput)
-
setWorkingDirectory
public void setWorkingDirectory(java.lang.String workingDirectory)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
copyOutputTo
public void copyOutputTo(java.io.OutputStream out)
-
checkForError
public void checkForError()
-
-