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

io.linguarobot.aws.cdk.maven.process.ProcessRunner Maven / Gradle / Ivy

Go to download

The AWS CDK Maven plugin produces and deploys CloudFormation templates based on the cloud infrastructure defined by means of CDK. The goal of the project is to improve the experience of Java developers while working with CDK by eliminating the need for installing Node.js and interacting with the CDK application by means of CDK Toolkit.

There is a newer version: 0.0.8
Show newest version
package io.linguarobot.aws.cdk.maven.process;

import java.io.ByteArrayOutputStream;
import java.util.List;

/**
 * A runner of external processes.
 */
public interface ProcessRunner {

    /**
     * Starts an external process using the given command.
     *
     * @param command the command to execute
     * @throws ProcessExecutionException in case the process fails or returns an exit code that is different from zero.
     * @return the output of the process (including error).
     */
    default String run(List command) {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        ProcessContext processContext = ProcessContext.builder()
                .withOutput(output)
                .build();
        run(command, processContext);
        return output.toString();
    }

    /**
     * Starts an external process using the given command.
     *
     * @param command the command to execute
     * @param processContext the process context
     * @throws ProcessExecutionException in case the process fails or returns an exit code that is different from zero.
     * @return the process exit code
     */
    int run(List command, ProcessContext processContext);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy