Package com.dtolabs.rundeck.core.execution.service

Examples of com.dtolabs.rundeck.core.execution.service.FileCopierException


            FileCopierException {
            testContext = context;
            testNode = node;
            testInput = input;
            if (throwException) {
                throw new FileCopierException("copyFileStream test",TestReason.Test);
            }
            return testResult;
        }
View Full Code Here


        public String copyFile(ExecutionContext context, File file, INodeEntry node) throws FileCopierException {
            testContext = context;
            testNode = node;
            testFile = file;
            if (throwException) {
                throw new FileCopierException("copyFile test", TestReason.Test);
            }
            return testResult;
        }
View Full Code Here

            testContext = context;
            testNode = node;
            testScript = script;

            if (throwException) {
                throw new FileCopierException("copyScriptContent test", TestReason.Test);
            }
            return testResult;
        }
View Full Code Here

            FileCopierException {
            testContext = context;
            testNode = node;
            testInput = input;
            if(throwException) {
                throw new FileCopierException("copyFileStream test", TestReason.Test);
            }
            return testResult;
        }
View Full Code Here

        public String copyFile(ExecutionContext context, File file, INodeEntry node) throws FileCopierException {
            testContext = context;
            testNode = node;
            testFile = file;
            if (throwException) {
                throw new FileCopierException("copyFile test", TestReason.Test);
            }
            return testResult;
        }
View Full Code Here

            testContext = context;
            testNode = node;
            testScript = script;

            if (throwException) {
                throw new FileCopierException("copyScriptContent test", TestReason.Test);
            }
            return testResult;
        }
View Full Code Here

                );
            } else {
                return null;
            }
        } catch (IOException e) {
            throw new FileCopierException(
                    "error writing script to tempfile: " + e.getMessage(),
                    StepFailureReason.IOFailure, e
            );
        }
        try {
View Full Code Here

            String script) throws FileCopierException {
        File tempfile = null;
        try {
            tempfile = ScriptfileUtils.createTempFile(context.getFramework());
        } catch (IOException e) {
            throw new FileCopierException("error writing to tempfile: " + e.getMessage(),
                    StepFailureReason.IOFailure, e);
        }
        return writeLocalFile(original, input, script, tempfile);
    }
View Full Code Here

                }
            }

            return destinationFile;
        } catch (IOException e) {
            throw new FileCopierException("error writing to tempfile: " + e.getMessage(),
                    StepFailureReason.IOFailure, e);
        }

    }
View Full Code Here

        try {

            scp = SSHTaskBuilder.buildScp(node, project, remotefile, localTempfile, nodeAuthentication,
                    context.getLoglevel(),context.getExecutionListener());
        } catch (SSHTaskBuilder.BuilderException e) {
            throw new FileCopierException("Configuration error: " + e.getMessage(),
                    StepFailureReason.ConfigurationFailure, e);
        }

        /**
         * Copy the file over
         */
        seq.addTask(createEchoVerbose("copying scriptfile: '" + localTempfile.getAbsolutePath()
                + "' to: '" + node.getNodename() + ":" + remotefile + "'", project));
        seq.addTask(scp);

        String errormsg = null;
        try {
            seq.execute();
        } catch (BuildException e) {
            JschNodeExecutor.ExtractFailure failure = JschNodeExecutor.extractFailure(e,
                    node,
                    nodeAuthentication.getSSHTimeout(),
                    framework);
            errormsg = failure.getErrormsg();
            FailureReason failureReason = failure.getReason();
            context.getExecutionListener().log(0, errormsg);
            context.getExecutionListener().log(0, errormsg);
            throw new FileCopierException("[jsch-scp] Failed copying the file: " + errormsg, failureReason, e);
        }
        if (!localTempfile.delete()) {
            context.getExecutionListener().log(Constants.WARN_LEVEL,
                    "Unable to remove local temp file: " + localTempfile.getAbsolutePath());
        }
View Full Code Here

TOP

Related Classes of com.dtolabs.rundeck.core.execution.service.FileCopierException

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.