Package org.openqa.selenium.os
Class ExternalProcess
java.lang.Object
org.openqa.selenium.os.ExternalProcess
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionExternalProcess
(Process process, CircularOutputStream outputStream, Thread worker) -
Method Summary
Modifier and TypeMethodDescriptionstatic ExternalProcess.Builder
builder()
int
The last N bytes of the combined stdout and stderr as String, the value of N is set while building the OsProcess.The last N bytes of the combined stdout and stderr as String, the value of N is set while building the OsProcess.boolean
isAlive()
void
shutdown()
Initiate a normal shutdown of the process or kills it when the process is alive after 4 seconds.void
Initiate a normal shutdown of the process or kills it when the process is alive after the given timeout.boolean
-
Constructor Details
-
ExternalProcess
-
-
Method Details
-
builder
-
getOutput
The last N bytes of the combined stdout and stderr as String, the value of N is set while building the OsProcess.- Returns:
- stdout and stderr as String in Charset.defaultCharset() encoding
-
getOutput
The last N bytes of the combined stdout and stderr as String, the value of N is set while building the OsProcess.- Parameters:
encoding
- the encoding to decode the stream- Returns:
- stdout and stderr as String in the given encoding
-
isAlive
public boolean isAlive() -
waitFor
- Throws:
InterruptedException
-
exitValue
public int exitValue() -
shutdown
public void shutdown()Initiate a normal shutdown of the process or kills it when the process is alive after 4 seconds. -
shutdown
Initiate a normal shutdown of the process or kills it when the process is alive after the given timeout.- Parameters:
timeout
- the duration for a process to terminate before destroying it forcibly.
-