public static boolean matchUrl(Account account, String url) {
        for (AccountPatternData pattern : account.getPatterns()) {
            AccountPatternType type = pattern.getType();
            if (type == AccountPatternType.REGEX) {
                if (regexMatch(pattern.getPattern(), url))
                    return true;
            } else if (type == AccountPatternType.WILDCARD) {
                if (globMatch(pattern.getPattern(), url))
                    return true;
            } else {
                Logger logger = Logger.getLogger(AccountPatternMatcher.class.getName());
                logger.warning("Unknown pattern match type '" + type.toString() + "' for account '" +
                        account.getName() + "' id='" + account.getId() + "'");
                // meh
            }
        }
        return account.getUrl().equalsIgnoreCase(url);
    }
public static boolean matchUrl ( Account account , String url ) { for ( AccountPatternData pattern : account . getPatterns ( ) ) { AccountPatternType type = pattern . getType ( ) ; if ( type == AccountPatternType . REGEX ) { if ( regexMatch ( pattern . getPattern ( ) , url ) ) return true ; } else if ( type == AccountPatternType . WILDCARD ) { if ( globMatch ( pattern . getPattern ( ) , url ) ) return true ; } else { Logger logger = Logger . getLogger ( AccountPatternMatcher . class . getName ( ) ) ; logger . warning ( "Unknown pattern match type '" + type . toString ( ) + "' for account '" + account . getName ( ) + "' id='" + account . getId ( ) + "'" ) ; } } return account . getUrl ( ) . equalsIgnoreCase ( url ) ; }
Tests all patterns in an account for a match against the url string.

@param account The account to test with.
@param url     THe url to test with.
@return true if one of the