public class CommandExecutor extends Object
Constructor and Description |
---|
CommandExecutor(Logger logger) |
Modifier and Type | Method and Description |
---|---|
int |
executeCommand(List<String> command,
File workingDirectory,
Map<String,String> environmentVariables)
Executes a command with
ProcessBuilder , but also logs the call
and redirects its input and output to our process. |
final Logger logger
public CommandExecutor(Logger logger)
public int executeCommand(List<String> command, File workingDirectory, Map<String,String> environmentVariables) throws IOException, InterruptedException
ProcessBuilder
, but also logs the call
and redirects its input and output to our process.command
- to have ProcessBuilder
executeworkingDirectory
- to pass to ProcessBuilder.directory()
environmentVariables
- to put in ProcessBuilder.environment()
IOException
InterruptedException
Copyright © 2023. All rights reserved.