Class DefaultPathFilter
java.lang.Object
org.apache.jackrabbit.vault.fs.filter.DefaultPathFilter
- All Implemented Interfaces:
Dumpable,Filter,PathFilter
The default path filter provides hierarchical filtering.
-
Field Summary
Fields inherited from interface org.apache.jackrabbit.vault.fs.api.PathFilter
ALL, NONE -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorDefaultPathFilter(String pattern) Creates a new default path filter -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(DumpContext ctx, boolean isLast) Dumps some human readable information using the given context.booleanReturns the patterninthashCode()booleanChecks if the pattern is absolute, i.e.booleanChecks if the given path matches this filters criteria.voidsetPattern(String pattern) Sets the regexp pattern for this filter.toString()translate(PathMapping mapping) Translates this path filter with the given mapping.
-
Constructor Details
-
DefaultPathFilter
public DefaultPathFilter()Default constructor -
DefaultPathFilter
Creates a new default path filter- Parameters:
pattern- the pattern- Throws:
ConfigurationException- in case an invalid regex pattern was given.- See Also:
-
-
Method Details
-
setPattern
Sets the regexp pattern for this filter. Examples:| Pattern | Matches | /foo | exactly "/foo" | /foo.* | all paths starting with "/foo" | ^.* /foo[^/]*$ | all files starting with "foo" | /foo/[^/]*$ | all direct children of /foo | /foo/.* | all children of /foo | /foo(/.*)? | all children of /foo and foo itself
- Parameters:
pattern- the pattern.- Throws:
ConfigurationException- in case an invalid regex pattern was given.
-
getPattern
Returns the pattern- Returns:
- the pattern
-
matches
Checks if the given path matches this filters criteria.- Specified by:
matchesin interfacePathFilter- Parameters:
path- the path to check- Returns:
trueif this filter matches the criteria;falseotherwise.
-
isAbsolute
public boolean isAbsolute()Checks if the pattern is absolute, i.e. does not start with a wildcard.- Specified by:
isAbsolutein interfacePathFilter- Returns:
trueif pattern is absolute
-
translate
Translates this path filter with the given mapping. Note that only absolute filters can be translated.- Specified by:
translatein interfacePathFilter- Parameters:
mapping- the mapping to apply- Returns:
- the new filter
-
equals
-
hashCode
public int hashCode() -
toString
-
dump
Dumps some human readable information using the given context.
-