RegExResourceName.java revision 3b378070747e5d2b61c5db3e0bc42795a420f024
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* Portions Copyrighted 2014 Forgerock AS.
*
* $Id: RegExResourceName.java,v 1.1 2009/12/07 19:53:02 veiming Exp $
*
* Portions Copyrighted 2014 ForgeRock AS.
*/
/**
* A {@link ResourceName} implementation that matches the resourcenames using regular expressions.
*/
public class RegExResourceName implements ResourceName {
private static final ReadWriteLock patternCacheLock =
new ReentrantReadWriteLock();
private static final int MAX_CACHE_SIZE = 1000;
return null;
}
// do nothing
}
boolean wildcardCompare) {
} else {
return ResourceMatch.EXACT_MATCH;
}
}
}
return result;
}
}
}
return ResourceMatch.SUB_RESOURCE_MATCH;
}
return ResourceMatch.SUPER_RESOURCE_MATCH;
}
return ResourceMatch.NO_MATCH;
}
// Remove duplicate /
{
}
{
}
return superResource+subResource;
}
}
}
return res;
}
return ResourceMatch.SUB_RESOURCE_MATCH;
}
return ResourceMatch.SUPER_RESOURCE_MATCH;
}
return ResourceMatch.WILDCARD_MATCH;
} else {
return ResourceMatch.SUB_RESOURCE_MATCH;
}
} else {
return ResourceMatch.WILDCARD_MATCH;
} else {
return ResourceMatch.SUPER_RESOURCE_MATCH;
}
}
return ResourceMatch.NO_MATCH;
}
}
try {
return pattern;
}
char c = strPattern.charAt(i);
if (c == '.') {
} else if (c == '*') {
} else if (c == '?') {
} else if (c == '+') {
} else {
}
}
if (lastChar == '*') {
} else {
}
return pattern;
} finally {
}
}
throw new UnsupportedOperationException("Not implemented");
}
}