Package com.alphacsp.cit.exec

Examples of com.alphacsp.cit.exec.DefaultProcessLauncher


        VariableValue editor = executionContext.getEnvironment().getVar(getVariableName());
        List<String> parameters = executionContext.getParameters();
        List<String> commands = new ArrayList<String>();
        commands.add(editor.getAsText());
        commands.addAll(parameters);
        DefaultProcessLauncher processLauncher = new DefaultProcessLauncher();
        Environment environment = executionContext.getEnvironment();
        processLauncher.setWorkingDir(environment.pwd().getAsFile());
        processLauncher.addCommands(commands);
        processLauncher.addEnvironmentVariables(environment.getVars());
        processLauncher.exec();
    }
View Full Code Here


            throw new RuntimeException("This class (" + UnixExecutableCalculation.class + ") runs only on unix or cygwin!");
        }

        checkIntegrity(context);

        ProcessLauncher scriptLanucher = new DefaultProcessLauncher();
        scriptLanucher.addCommand("which");
        scriptLanucher.addCommand(getExecutableName());
        Process process = scriptLanucher.exec();
        String output = ProcessUtils.readOutput(process).trim();
        int exitCode = process.exitValue();
        if (exitCode != 0 || output.length() == 0) {
            throw new ValidationException("Executable " + getExecutableName() + " was not found!");
        }
View Full Code Here

TOP

Related Classes of com.alphacsp.cit.exec.DefaultProcessLauncher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.