Interface ProcessWrapper
- All Known Implementing Classes:
ProcessWrapperImpl
@ScannerSide
@SonarLintSide(lifespan="MULTIPLE_ANALYSES")
public interface ProcessWrapper
This interface provides thin wrapper around Java ProcessBuilder and related APIs. The goal is to make them testable
across different OS flavors.
It also handles the issue of consuming stdout and stderr of started process in an asynchronous way using a daemon
thread
-
Method Details
-
startProcess
Process startProcess(List<String> commandLine, Map<String, String> env, Consumer<String> outputConsumer, Consumer<String> errorConsumer) throws IOException- Throws:
IOException
-
waitFor
- Throws:
InterruptedException
-
interrupt
void interrupt() -
destroyForcibly
-
isMac
boolean isMac() -
isWindows
boolean isWindows() -
getenv
-
exitValue
-