gerrithudsontrigger/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritDynamicUrlProcessor.java
/**
     * Build the regex pattern for matching lines in the config.
     * @return the pattern
     */
Build the regex pattern for matching lines in the config.
@return the pattern
Build the regex pattern for matching lines in the config . @return the pattern
private static Pattern buildLinePattern() {
      String projectBranchFile = "^("
              + SHORTNAME_PROJECT
              + "|" + SHORTNAME_BRANCH
              + "|" + SHORTNAME_FILE
              + ")";
      String operators = "(";
      boolean firstoperator = true;
      for (CompareType type : CompareType.values()) {
        if (!firstoperator) {
          operators += "|";
        }
        operators += type.getOperator();
        firstoperator = false;
      }
      operators += ")";
      return Pattern.compile(projectBranchFile
              + "\\s*"
              + operators
              + "\\s*(.+)$");
    }
private static Pattern buildLinePattern ( ) { String projectBranchFile = "^(" + SHORTNAME_PROJECT + "|" + SHORTNAME_BRANCH + "|" + SHORTNAME_FILE + ")" ; String operators = "(" ; boolean firstoperator = true ; for ( CompareType type : CompareType . values ( ) ) { if ( ! firstoperator ) { operators += "|" ; } operators += type . getOperator ( ) ; firstoperator = false ; } operators += ")" ; return Pattern . compile ( projectBranchFile + "\\s*" + operators + "\\s*(.+)$" ) ; }
Build the regex pattern for matching lines in the config.
Build the regex pattern for matching lines in the config .
// This is what a line in the file should look like, after all comments and // leading and trailing whitespace have been removed: // item: one of the characters p (for Project), b (for Branch) or f (for FilePath) // optional whitespace // operator: one of the characters = (for Plain), ~ (for RegExp), or ^ (for ANT path) // optional whitespace // the pattern: everything else on the line