Package com.atlassian.bamboo.utils.error

Examples of com.atlassian.bamboo.utils.error.ErrorCollection


    return config;
  }

  @NotNull
  public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration)  {
    ErrorCollection errorCollection = super.validate(buildConfiguration);

        String repName = buildConfiguration.getString(Constants.PLASTIC_REPOSITORY);
        String repServer = buildConfiguration.getString(Constants.PLASTIC_REPOSITORYSERVER);
        String branch = buildConfiguration.getString(Constants.PLASTIC_BRANCH_TO_TRACK);

    if (repName == null || repName.trim().length() == 0) {
      errorCollection.addError(Constants.PLASTIC_REPOSITORY, "The repository name must be specified");
    }

    try  {
            BranchInfo brInfo;
            if (branch.equals(Constants.BR_NAME))
                brInfo = Utils.getBranchInfo(Constants.MAIN, repName, repServer);
            else
                brInfo = Utils.getBranchInfo(branch, repName, repServer);

            if (brInfo == null)
                throw new Exception("Branch not found:" + branch);
    }
    catch(Exception ex) {
      errorCollection.addError(Constants.PLASTIC_BRANCH_TO_TRACK,
                    "The specified branch does not exist in the specified repository and server.");
    }
    return errorCollection;
  }
View Full Code Here

TOP

Related Classes of com.atlassian.bamboo.utils.error.ErrorCollection

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.