Class GlobPattern
- java.lang.Object
-
- org.apache.jackrabbit.core.security.authorization.GlobPattern
-
public final class GlobPattern extends Object
GlobPatterndefines a simplistic pattern matching. It consists of a mandatory (leading) path and an optional "glob" that may contain one or more wildcard characters ("*") according to the glob matching defined byNode.getNodes(String[]). In contrast to that method theGlobPatternoperates on path (not only names).Please note the following special cases:
NodePath | Restriction | Matches ----------------------------------------------------------------------------- /foo | null | matches /foo and all children of /foo /foo | "" | matches /foo only
Examples including wildcard char:
NodePath = "/foo" Restriction | Matches ----------------------------------------------------------------------------- * | all siblings of foo and foo's and the siblings' descendants /*cat | all children of /foo whose path ends with "cat" /*/cat | all non-direct descendants of /foo named "cat" /cat* | all descendant path of /foo that have the direct foo-descendant segment starting with "cat" *cat | all siblings and descendants of foo that have a name ending with cat */cat | all descendants of /foo and foo's siblings that have a name segment "cat" cat/* | all descendants of '/foocat' /cat/* | all descendants of '/foo/cat' *cat/* | all descendants of /foo that have an intermediate segment ending with 'cat'
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GlobPatterncreate(String nodePath)static GlobPatterncreate(String nodePath, String restrictions)booleanequals(Object obj)inthashCode()booleanmatches(String toMatch)booleanmatches(Item itemToMatch)StringtoString()
-
-
-
Method Detail
-
create
public static GlobPattern create(String nodePath, String restrictions)
-
create
public static GlobPattern create(String nodePath)
-
matches
public boolean matches(String toMatch)
-
matches
public boolean matches(Item itemToMatch)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObject- See Also:
Object.hashCode()
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classObject- See Also:
Object.equals(Object)
-
-