Class PathFilterSet
java.lang.Object
org.apache.jackrabbit.vault.fs.api.FilterSet<PathFilter>
org.apache.jackrabbit.vault.fs.api.PathFilterSet
- All Implemented Interfaces:
Dumpable
The path filter set holds a set of path filters each attributes as include
or exclude filter. The evaluation of the set allows included paths and
rejects excluded paths.
Additionally it contains a "root" path for which the filters are evaluated. if an item has not the node addressed by the root path as ancestor, it is always excluded.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.jackrabbit.vault.fs.api.FilterSet
FilterSet.Entry<E extends Filter> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PathFilterSetThe exclude all item filter setstatic final PathFilterSetThe include all item filter setstatic final StringPathFilterSets of this type are only used to remove nodes during import and ignored for calculation of the package type. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PathFilterSet(@NotNull String root) Creates a new path filter set and sets the respective root path -
Method Summary
Modifier and TypeMethodDescriptionbooleanEvaluates the filters if this set doescoverthe given item.@Nullable StringgetType()Returns the filter type ornullbooleanChecks if this path filter set only contains entries that are relative include patterns, eg: ".* /foo.*".@NotNull FilterSet<PathFilter> seal()Seals this list, i.e.@NotNull PathFilterSetSets the filter type@NotNull PathFilterSettranslate(@Nullable PathMapping mapping) Translates this path filter with the given mapping.Methods inherited from class org.apache.jackrabbit.vault.fs.api.FilterSet
addAll, addExclude, addInclude, covers, dump, equals, getEntries, getImportMode, getRoot, hashCode, isAncestor, isEmpty, isSealed, setImportMode, setRoot, toString
-
Field Details
-
TYPE_CLEANUP
PathFilterSets of this type are only used to remove nodes during import and ignored for calculation of the package type.- See Also:
-
INCLUDE_ALL
The include all item filter set -
EXCLUDE_ALL
The exclude all item filter set
-
-
Constructor Details
-
PathFilterSet
public PathFilterSet()Default constructor. initializes the root path to "/" -
PathFilterSet
Creates a new path filter set and sets the respective root path- Parameters:
root- path
-
-
Method Details
-
contains
Evaluates the filters if this set doescoverthe given item. otherwisefalseis returned. The result of the evaluation is the polarity of the last matched path. If no filter matches it returnstrueif the first filter is an exclude filter or if no filter is defined;falseif the first filter is an include filter.- Parameters:
path- the path to check- Returns:
trueif this set matches the item
-
seal
Description copied from class:FilterSetSeals this list, i.e. makes it unmodifiable.- Overrides:
sealin classFilterSet<PathFilter>- Returns:
- this list
-
translate
Translates this path filter with the given mapping. Note that only absolute filters can be translated.- Parameters:
mapping- the mapping to apply- Returns:
- the new filter
- Since:
- 2.4.10
-
hasOnlyRelativePatterns
public boolean hasOnlyRelativePatterns()Checks if this path filter set only contains entries that are relative include patterns, eg: ".* /foo.*". in this case the aggregator will use a different strategy when providing non matching leave nodes.- Returns:
trueif only contains relative patterns
-
getType
Returns the filter type ornull- Returns:
- the filter type.
-
setType
Sets the filter type- Parameters:
type- the type- Returns:
- this.
-