Class PathFilterSet
- java.lang.Object
-
- org.apache.jackrabbit.vault.fs.api.FilterSet<PathFilter>
-
- org.apache.jackrabbit.vault.fs.api.PathFilterSet
-
- All Implemented Interfaces:
Dumpable
public class PathFilterSet extends FilterSet<PathFilter>
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
Fields Modifier and Type Field Description static PathFilterSet
EXCLUDE_ALL
The exclude all item filter setstatic PathFilterSet
INCLUDE_ALL
The include all item filter setstatic String
TYPE_CLEANUP
PathFilterSets of this type are only used to remove nodes during import and ignored for calculation of the package type.
-
Constructor Summary
Constructors Constructor Description PathFilterSet()
Default constructor. initializes the root path to "/"PathFilterSet(@NotNull String root)
Creates a new path filter set and sets the respective root path
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(@NotNull String path)
Evaluates the filters if this set doescover
the given item. otherwisefalse
is returned.@Nullable String
getType()
Returns the filter type ornull
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.@NotNull FilterSet<PathFilter>
seal()
Seals this list, i.e. makes it unmodifiable.@NotNull PathFilterSet
setType(@Nullable String type)
Sets the filter type@NotNull PathFilterSet
translate(@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 Detail
-
TYPE_CLEANUP
public static final String TYPE_CLEANUP
PathFilterSets of this type are only used to remove nodes during import and ignored for calculation of the package type.- See Also:
- Constant Field Values
-
INCLUDE_ALL
public static final PathFilterSet INCLUDE_ALL
The include all item filter set
-
EXCLUDE_ALL
public static final PathFilterSet EXCLUDE_ALL
The exclude all item filter set
-
-
Constructor Detail
-
PathFilterSet
public PathFilterSet()
Default constructor. initializes the root path to "/"
-
PathFilterSet
public PathFilterSet(@NotNull @NotNull String root)
Creates a new path filter set and sets the respective root path- Parameters:
root
- path
-
-
Method Detail
-
contains
public boolean contains(@NotNull @NotNull String path)
Evaluates the filters if this set doescover
the given item. otherwisefalse
is returned. The result of the evaluation is the polarity of the last matched path. If no filter matches it returnstrue
if the first filter is an exclude filter or if no filter is defined;false
if the first filter is an include filter.- Parameters:
path
- the path to check- Returns:
true
if this set matches the item
-
seal
@NotNull public @NotNull FilterSet<PathFilter> seal()
Description copied from class:FilterSet
Seals this list, i.e. makes it unmodifiable.- Overrides:
seal
in classFilterSet<PathFilter>
- Returns:
- this list
-
translate
@NotNull public @NotNull PathFilterSet translate(@Nullable @Nullable PathMapping mapping)
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:
true
if only contains relative patterns
-
getType
@Nullable public @Nullable String getType()
Returns the filter type ornull
- Returns:
- the filter type.
-
setType
@NotNull public @NotNull PathFilterSet setType(@Nullable @Nullable String type)
Sets the filter type- Parameters:
type
- the type- Returns:
- this.
-
-