Class GlobPattern
- java.lang.Object
-
- org.apache.jackrabbit.core.security.authorization.GlobPattern
-
public final class GlobPattern extends Object
GlobPattern
defines 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 theGlobPattern
operates 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 GlobPattern
create(String nodePath)
static GlobPattern
create(String nodePath, String restrictions)
boolean
equals(Object obj)
int
hashCode()
boolean
matches(String toMatch)
boolean
matches(Item itemToMatch)
String
toString()
-
-
-
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:
hashCode
in classObject
- See Also:
Object.hashCode()
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classObject
- See Also:
Object.equals(Object)
-
-