All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.arquillian.cube.impl.util.CommandLineExecutor Maven / Gradle / Ivy

There is a newer version: 2.0.0.Alpha1
Show newest version
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