class StringUtils {

    public static boolean requestUriMatch(String uri, Set<String> uriSet,
            List<Pattern> uriList) {
        
        // first we're going to check if we have the uri in our set
        
        if (uriSet != null && uriSet.contains(uri)) {
            return true;
        }
        
        // if not in our set, we'll check our pattern list for a regex match
        
        if (uriList != null) {
            for (Pattern pattern : uriList) {
                Matcher matcher = pattern.matcher(uri);
                if (matcher.matches()) {
                    return true;
                }
            }
        }
        return false;
    }

}