Package net.sourceforge.cruisecontrol

Examples of net.sourceforge.cruisecontrol.CruiseControlException


        }
    }

    public void validate() throws CruiseControlException {
        if (filename == null && cvsroot == null && localWorkingCopy == null) {
            throw new CruiseControlException(
                "at least one of 'file', 'cvsroot' or 'localworkingcopy' "
                    + "is required as an attribute for CVSBootstrapper");
        }

        if (localWorkingCopy != null) {
            File workingDir = new File(localWorkingCopy);
            if (!workingDir.exists()) {
                throw new CruiseControlException(
                    "'localWorkingCopy' must be an existing directory.  Was <"
                        + localWorkingCopy
                        + ">");
            } else if (!workingDir.isDirectory()) {
                throw new CruiseControlException(
                    "'localWorkingCopy' must be an existing directory, not a file.  Was <"
                        + localWorkingCopy
                        + ">");
            }
        }
View Full Code Here


            ((SerialGateway) transmitter).setPortName(port);
        }
        try {
            ((Gateway) transmitter).allocate();
        } catch (Exception e) {
            throw new CruiseControlException("Trouble allocating the x10 gateway.", e);
        }

        for (int j = 0; j < events.length; j++) {
            LOG.debug("Transmitting: " + events[ j ]);
            try {
                transmitter.transmit(events[ j ]);
            } catch (IOException e) {
                throw new CruiseControlException("Trouble transmitting event " + events[ j ], e);
            }
        }

        if (transmitter instanceof Gateway) {
            Gateway gateway = (Gateway) transmitter;
View Full Code Here

        if (interfaceModel != null && interfaceModel.equalsIgnoreCase("CM17A")) {
            return new CM17A();
        } else if (interfaceModel == null || interfaceModel.equals("") || interfaceModel.equalsIgnoreCase("CM11A")) {
            return new CM11A();
        } else {
            throw new CruiseControlException("Unknown interface model specified [" + interfaceModel + "].");
        }
    }
View Full Code Here

        }
    }

    public void validate() throws CruiseControlException {
        if (filename == null) {
            throw new CruiseControlException("'file' is required for ClearCaseBootstrapper");
        }
    }
View Full Code Here

            new Thread(new StreamPumper(p.getInputStream())).start();
            new Thread(new StreamPumper(p.getErrorStream())).start();
            p.waitFor();

        } catch (IOException e) {
            throw new CruiseControlException("Problem trying to execute command line process", e);
        } catch (InterruptedException e) {
            throw new CruiseControlException("Problem trying to execute command line process", e);
        }
    }
View Full Code Here

        int exitCode = -1;

        try {
            p = commandline.execute();
        } catch (IOException e) {
            throw new CruiseControlException("Encountered an IO exception while attempting to execute '"
                    + script.toString() + "'. CruiseControl cannot continue.", e);
        }

        StreamPumper errorPumper;
        StreamPumper outPumper;
View Full Code Here

     *
     *  @throws net.sourceforge.cruisecontrol.CruiseControlException if there was a configuration error.
     */
    public void validate() throws CruiseControlException {
        if (targetHost == null) {
            throw new CruiseControlException("'targethost' not specified in configuration file");
        }
        if (targetDir == null) {
            targetDir = ".";
        }
    }
View Full Code Here

        FTPClient ftp = new FTPClient();

        try {
            ftp.connect(targetHost, targetPort);
            if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
                throw new CruiseControlException("FTP connection failed: "
                     + ftp.getReplyString());
            }
   
            LOG.info("logging in to FTP server");
            if (!ftp.login(targetUser, targetPasswd)) {
                throw new CruiseControlException("Could not login to FTP server");
            }
            LOG.info("login succeeded");
           
            if (passive) {
                setPassive(ftp);
            }
        } catch (IOException ioe) {
            LOG.error(ioe);
            throw new CruiseControlException(ioe.getMessage());
        }
        return ftp;
    }
View Full Code Here

   
    protected void setBinary(FTPClient ftp) throws CruiseControlException {
        try {
            ftp.setFileType(FTP.IMAGE_FILE_TYPE);
            if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
                throw new CruiseControlException(
                    "could not set transfer type: "
                    + ftp.getReplyString());
            }
        } catch (IOException ex) {
            LOG.error(ex);
            throw new CruiseControlException(ex.getMessage());
        }
    }
View Full Code Here

   
    private void setPassive(FTPClient ftp) throws CruiseControlException {
        LOG.info("entering passive mode");
        ftp.enterLocalPassiveMode();
        if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
            throw new CruiseControlException("could not enter into passive "
                 + "mode: " + ftp.getReplyString());
        }
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.CruiseControlException

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.