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)Deprecated.CommandLine(java.lang.String executable, java.lang.String... args)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckForError()voidcopyOutputTo(java.io.OutputStream out)intdestroy()Destroy the current command.voidexecute()voidexecuteAsync()intgetExitCode()static java.lang.StringgetLibraryPathPropertyName()java.lang.StringgetStdOut()booleanisRunning()Check whether the current command is still executing.booleanisSuccessful()voidsetDynamicLibraryPath(java.lang.String newLibraryPath)voidsetEnvironmentVariable(java.lang.String name, java.lang.String value)Adds the specified environment variable.voidsetEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> environment)Adds the specified environment variables.voidsetInput(java.lang.String allInput)voidsetWorkingDirectory(java.lang.String workingDirectory)java.lang.StringtoString()voidupdateDynamicLibraryPath(java.lang.String extraPath)voidwaitFor()voidwaitFor(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:
toStringin classjava.lang.Object
-
copyOutputTo
public void copyOutputTo(java.io.OutputStream out)
-
checkForError
public void checkForError()
-
-