Package org.jboss.modules.filter
Class PathFilters
java.lang.Object
org.jboss.modules.filter.PathFilters
Static factory methods for path filter types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PathFilterprivate static final PathFilterprivate static final PathFilterprivate static final PathFilterprivate static final PathFilterprivate static final PathFilter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathFilterGet a filter which always returnstrue.static PathFilterall(Collection<PathFilter> filters) Get a path filter which returnstrueif all of the given filters returntrue.static PathFilterall(PathFilter... filters) Get a path filter which returnstrueif all of the given filters returntrue.static PathFilterany(Collection<PathFilter> filters) Get a path filter which returnstrueif any of the given filters returntrue.static PathFilterany(PathFilter... filters) Get a path filter which returnstrueif any of the given filters returntrue.private static BooleanPathFilterbooleanFilter(boolean val) filtered(PathFilter filter, Iterator<Resource> original) Get a filtered view of a resource iteration.static PathFilterGet the default import path filter, which excludes all ofMETA-INFand its subdirectories.static PathFilterGet the default import-with-services path filter which excludes all ofMETA-INFand its subdirectories, with the exception ofMETA-INF/services.static PathFilterGet a filter which matches the path"META-INF".static PathFilterGet a filter which matches the path"META-INF/services".static PathFilterGet a filter which matches any subdirectory of the path"META-INF".static PathFilterGet a filter which matches all ofMETA-INF's subdirectories, but notMETA-INFitself.static PathFilterin(Collection<String> paths) Get a filter which returnstrueif the tested path is contained within the given collection.static PathFilterGet a filter which returnstrueif the tested path is contained within the given set.static PathFilterGet a path filter which matches an exact path name.static PathFilterGet a path filter which matches any path which is a child of the given path name (not including the path name itself).static PathFilterisOrIsChildOf(String path) Get a path filter which matches any path which is equal to, or a child of, the given path name.static PathFilterGet a path filter which matches a glob.static MultiplePathFilterBuildermultiplePathFilterBuilder(boolean defaultValue) Get a builder for a multiple-path filter.static PathFilternone(Collection<PathFilter> filters) Get a path filter which returnstrueif none of the given filters returntrue.static PathFilternone(PathFilter... filters) Get a path filter which returnstrueif none of the given filters returntrue.static PathFilternot(PathFilter filter) Get a path filter which istruewhen the given filter isfalse, and vice-versa.static PathFilterGet a filter which always returnsfalse.
-
Field Details
-
defaultImportFilter
-
defaultImportFilterWithServices
-
metaInfFilter
-
metaInfSubdirectoriesFilter
-
metaInfServicesFilter
-
metaInfSubdirectoriesWithoutMetaInfFilter
-
-
Constructor Details
-
PathFilters
private PathFilters()
-
-
Method Details
-
all
Get a path filter which returnstrueif all of the given filters returntrue.- Parameters:
filters- the filters- Returns:
- the "all" filter
-
all
Get a path filter which returnstrueif all of the given filters returntrue.- Parameters:
filters- the filters- Returns:
- the "all" filter
-
any
Get a path filter which returnstrueif any of the given filters returntrue.- Parameters:
filters- the filters- Returns:
- the "any" filter
-
any
Get a path filter which returnstrueif any of the given filters returntrue.- Parameters:
filters- the filters- Returns:
- the "any" filter
-
none
Get a path filter which returnstrueif none of the given filters returntrue.- Parameters:
filters- the filters- Returns:
- the "none" filter
-
none
Get a path filter which returnstrueif none of the given filters returntrue.- Parameters:
filters- the filters- Returns:
- the "none" filter
-
not
Get a path filter which istruewhen the given filter isfalse, and vice-versa.- Parameters:
filter- the filter- Returns:
- the inverting filter
-
match
Get a path filter which matches a glob. The given glob is a path separated by "/" characters, which may include the special "*" and "**" segment strings which match any directory and any number of nested directories, respectively.- Parameters:
glob- the glob- Returns:
- a filter which returns
trueif the glob matches
-
is
Get a path filter which matches an exact path name.- Parameters:
path- the path name- Returns:
- a filter which returns
trueif the path name is an exact match
-
isChildOf
Get a path filter which matches any path which is a child of the given path name (not including the path name itself).- Parameters:
path- the path name- Returns:
- a filter which returns
trueif the path name is a child of the given path
-
isOrIsChildOf
Get a path filter which matches any path which is equal to, or a child of, the given path name.- Parameters:
path- the path name- Returns:
- a filter which returns
trueif the path name is equal to, or a child of, the given path
-
multiplePathFilterBuilder
Get a builder for a multiple-path filter. Such a filter contains multiple filters, each associated with a flag which indicates that matching paths should be included or excluded.- Parameters:
defaultValue- the value to return if none of the nested filters match- Returns:
- the builder
-
booleanFilter
-
acceptAll
Get a filter which always returnstrue.- Returns:
- the accept-all filter
-
rejectAll
Get a filter which always returnsfalse.- Returns:
- the reject-all filter
-
in
Get a filter which returnstrueif the tested path is contained within the given set. Each member of the set is a path separated by "/" characters;nulls are disallowed.- Parameters:
paths- the path set- Returns:
- the filter
-
in
Get a filter which returnstrueif the tested path is contained within the given collection. Each member of the collection is a path separated by "/" characters;nulls are disallowed.- Parameters:
paths- the path collection- Returns:
- the filter
-
filtered
Get a filtered view of a resource iteration. Only resources which pass the given filter are accepted.- Parameters:
filter- the filter to checkoriginal- the original iterator- Returns:
- the filtered iterator
-
getDefaultImportFilter
Get the default import path filter, which excludes all ofMETA-INFand its subdirectories.- Returns:
- the default import path filter
-
getDefaultImportFilterWithServices
Get the default import-with-services path filter which excludes all ofMETA-INFand its subdirectories, with the exception ofMETA-INF/services.- Returns:
- the default import-with-services path filter
-
getMetaInfFilter
Get a filter which matches the path"META-INF".- Returns:
- the filter
-
getMetaInfSubdirectoriesFilter
Get a filter which matches any subdirectory of the path"META-INF".- Returns:
- the filter
-
getMetaInfServicesFilter
Get a filter which matches the path"META-INF/services".- Returns:
- the filter
-
getMetaInfSubdirectoriesWithoutMetaInfFilter
Get a filter which matches all ofMETA-INF's subdirectories, but notMETA-INFitself.- Returns:
- the filter
-