Package com.google.gerrit.common.errors

Examples of com.google.gerrit.common.errors.InvalidNameException


    }
    if (!refname.startsWith(Constants.R_REFS)) {
      refname = Constants.R_HEADS + refname;
    }
    if (!Repository.isValidRefName(refname)) {
      throw new InvalidNameException();
    }
    if (MagicBranch.isMagicBranch(refname)) {
      throw new BranchCreationNotAllowedException(refname);
    }
View Full Code Here


  public static void validateRefPattern(String refPattern)
      throws InvalidNameException {
    if (refPattern.startsWith(RefConfigSection.REGEX_PREFIX)) {
      if (!Repository.isValidRefName(RefControl.shortestExample(refPattern))) {
        throw new InvalidNameException(refPattern);
      }
    } else if (refPattern.equals(RefConfigSection.ALL)) {
      // This is a special case we have to allow, it fails below.
    } else if (refPattern.endsWith("/*")) {
      String prefix = refPattern.substring(0, refPattern.length() - 2);
      if (!Repository.isValidRefName(prefix)) {
        throw new InvalidNameException(refPattern);
      }
    } else if (!Repository.isValidRefName(refPattern)) {
      throw new InvalidNameException(refPattern);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gerrit.common.errors.InvalidNameException

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.