Class ProcessExecutor
- java.lang.Object
-
- org.kie.server.integrationtests.shared.ProcessExecutor
-
- All Implemented Interfaces:
AutoCloseable
public class ProcessExecutor extends Object implements AutoCloseable
Used for executing various bash commands.
-
-
Constructor Summary
Constructors Constructor Description ProcessExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanexecuteProcessCommand(String command)Execute command and wait until command is finished.booleanexecuteProcessCommand(String command, Path directory)Execute command and wait until command is finished.
-
-
-
Method Detail
-
executeProcessCommand
public boolean executeProcessCommand(String command)
Execute command and wait until command is finished. Output and error streams are redirected to the logger.- Parameters:
command- Command to be executed.- Returns:
- True if process terminated normally, false in case of error during processing.
-
executeProcessCommand
public boolean executeProcessCommand(String command, Path directory)
Execute command and wait until command is finished. Output and error streams are redirected to the logger.- Parameters:
command- Command to be executed.directory- Directory where the command should be executed.- Returns:
- True if process terminated normally, false in case of error during processing.
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-