Class HttpURLResourceName
- java.lang.Object
-
- org.forgerock.openam.shared.resourcename.BasePrefixResourceName<T,E>
-
- org.forgerock.openam.shared.resourcename.BaseURLResourceName<ResourceMatch,MalformedURLException>
-
- com.sun.identity.shared.whitelist.URLResourceName
-
- com.sun.identity.shared.whitelist.HttpURLResourceName
-
- All Implemented Interfaces:
ResourceName,BaseResourceName<ResourceMatch,MalformedURLException>
public class HttpURLResourceName extends URLResourceName
This implementation ofResourceNameextendsURLResourceNameto add special handling of resources which end in delimiter (BaseURLResourceName) followed by a multi level wildcard. Wildcard card at the end matches across levels. sohttp://abc.com/b/c/d/*matcheshttp://abc.com/b/c/d/e/f/g.htmlwhilehttp://abc.com/"*"/dmatches only string of typehttp://abc.com/a/d. So embedded wildcard matches only at that level where specified, while wildcard at the end, matches across levels. Behaviour of existing URLResourceName was not changed to maintain backward compatibility.
-
-
Field Summary
-
Fields inherited from class org.forgerock.openam.shared.resourcename.BaseURLResourceName
comparator
-
Fields inherited from class org.forgerock.openam.shared.resourcename.BasePrefixResourceName
caseSensitive, debug, delimiter, exactMatch, noMatch, oneLevelWildcard, oneLevelWildcardEmbedded, oneLevelWildcardLength, subResourceMatch, superResourceMatch, wildcard, wildcardEmbedded, wildcardLength, wildcardMatch
-
-
Constructor Summary
Constructors Constructor Description HttpURLResourceName()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceMatchcompare(String requestResource, String targetResource, boolean wildcardCompare)Compares two resources.-
Methods inherited from class com.sun.identity.shared.whitelist.URLResourceName
constructResourceInvalidException
-
Methods inherited from class org.forgerock.openam.shared.resourcename.BaseURLResourceName
canonicalize
-
Methods inherited from class org.forgerock.openam.shared.resourcename.BasePrefixResourceName
append, getServiceTypeNames, getSubResource, initialize, normalizeRequestResource, normalizeTargetResource, oneLevelWildcardCompare, split
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.forgerock.openam.shared.resourcename.BaseResourceName
append, canonicalize, getServiceTypeNames, getSubResource, initialize, split
-
-
-
-
Method Detail
-
compare
public ResourceMatch compare(String requestResource, String targetResource, boolean wildcardCompare)
Compares two resources. Description: The targetResource may contain wildcard '*' which matches zero or more characters. The wildcard character can show up anywhere within the string. The targetResource can contain any number of wildcard characters. One of the five possible match types is returned based on how the two resource strings are related. The comparison starts from the beginning of the reource strings. ResourceMatch.NO_MATCH means two resources don't match. ResourceMatch.EXACT_MATCH means two resources match. ResourceMatch.SUB_RESOURCE_MATCH means targetResource is a sub resource of the requestResource. ResourceMatch.SUPER_RESOURCE_MATCH means targetResource is a super resource of the requestResource. ResourceMatch.WILDCARD_MATCH means two resources match with respect to the wildcard.- Specified by:
comparein interfaceBaseResourceName<ResourceMatch,MalformedURLException>- Overrides:
comparein classBaseURLResourceName<ResourceMatch,MalformedURLException>- Parameters:
requestResource- name of the resource which will be comparedtargetResource- name of the resource which will be compared withwildcardCompare- flag for wildcard comparison- Returns:
- returns
ResourceMatchthat specifies if the resources are exact match, or otherwise.
-
-