org.arquillian.cube.impl.util.CommandLineExecutor Maven / Gradle / Ivy
package org.arquillian.cube.impl.util;
import java.io.IOException;
public class CommandLineExecutor {
public String execCommand(String... arguments) {
try {
ProcessBuilder processBuilder = new ProcessBuilder(arguments);
processBuilder.redirectErrorStream(true);
Process pwd = processBuilder.start();
pwd.waitFor();
String output = IOUtil.asString(pwd.getInputStream());
return output;
} catch (InterruptedException | IOException e) {
throw new IllegalArgumentException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy