Package net.sourceforge.cruisecontrol

Examples of net.sourceforge.cruisecontrol.CruiseControlException


        try {
            cmd.execute();
            cmd.assertExitCode(0);
        } catch (Exception e) {
            throw new CruiseControlException("Could not get a list of folders in project " + project, e);
        }

        // Try to find a matching folder name
        for (Iterator folders = cmd.getStdoutAsList().iterator(); folders
                .hasNext();) {
            String line = (String) folders.next();
            if (line.indexOf(folderName) > -1) {
                int index = line.indexOf(CMSynergy.CCM_ATTR_DELIMITER);
                if (index == -1) {
                    LOG.warn("Bad format in result: \"" + line + "\"");
                    continue;
                }
                index += CMSynergy.CCM_ATTR_DELIMITER.length();
                return line.substring(index).trim();
            }
        }

        // If we've gotten this far, no such folder exists in the project
        throw new CruiseControlException("Could not find a folder matching \""
                + folderName + "\" in project \"" + project + "\".");
    }
View Full Code Here


        return properties;
    }

    public void validate() throws CruiseControlException {
        if (pvcsProject == null) {
            throw new CruiseControlException("'pvcsproject' is a required attribute on PVCS");
        }
        if (pvcsSubProject == null) {
            throw new CruiseControlException("'pvcssubproject' is a required attribute on PVCS");
        }
    }
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) {
            ioe.printStackTrace();
            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) {
            ex.printStackTrace();
            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

                //  to indicate that an attempt to create a directory has
                //  failed because the directory already exists.
                int rc = ftp.getReplyCode();
                if (!(ignoreFailures
                     && (rc == 550 || rc == 553 || rc == 521))) {
                    throw new CruiseControlException(
                        "could not create directory: "
                        + ftp.getReplyString());
                }
                LOG.info("directory already exists");
            } else {
                LOG.info("directory created OK");
            }
        } catch (IOException ex) {
            ex.printStackTrace();
            throw new CruiseControlException(ex.getMessage());
        }
    }
View Full Code Here

            LOG.info("transferring " + infile.getAbsolutePath());

            instream = new BufferedInputStream(new FileInputStream(infile));
            sendStream(ftp, instream, outfilename);
        } catch (IOException ioe) {
            throw new CruiseControlException(ioe.getMessage());
        } finally {
            if (instream != null) {
                try {
                    instream.close();
                } catch (IOException ex) {
View Full Code Here

        try {
            ftp.storeFile(outfilename, instream);
            boolean success = FTPReply.isPositiveCompletion(ftp.getReplyCode());
   
            if (!success) {
                throw new CruiseControlException("could not put file: "
                    + ftp.getReplyString());
            }
        } catch (IOException ex) {
            ex.printStackTrace();
            throw new CruiseControlException(ex.getMessage());
        }
    }
View Full Code Here

                }
                */
                if (!ftp.changeWorkingDirectory(dir)) {
                    LOG.info("makeDirs: could not CD into " + dir);
                    if (!ftp.makeDirectory(dir)) {
                        throw new CruiseControlException(
                            "could not create directory [" + dir + ", full="
                            + fullPath + "]: "
                            + ftp.getReplyString());
                    }
                    LOG.info("makeDirs: created dir " + dir);
                    if (!ftp.changeWorkingDirectory(dir)) {
                        throw new CruiseControlException(
                            "could not change to directory: "
                            + ftp.getReplyString());
                    }
                    LOG.info("makeDirs: CDed into " + dir);
                }
                knownPaths.addElement(fullPath);
            }
            ftp.changeWorkingDirectory(cwd);
        } catch (IOException ex) {
            ex.printStackTrace();
            throw new CruiseControlException(ex.getMessage());
        }
    }
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.