static boolean ruleMatches(String rule, String path) {
	    boolean result = true;
	    
        URLEncodeTokenizer ruleTokens = new URLEncodeTokenizer(rule, URL_ENCODING_SPECIAL_CHARS);
        URLEncodeTokenizer pathTokens = new URLEncodeTokenizer(path, URL_ENCODING_SPECIAL_CHARS);
        while (ruleTokens.hasNext() && pathTokens.hasNext()) {
            Token token1 = ruleTokens.next();
            Token token2 = pathTokens.next();
            if (!token1.equals(token2)) {
                result = false;
                break;
            }
        }
        
        if (result && ruleTokens.hasNext()) {
            result = false;
        }
	    
	    return result;
	}