Package com.isomorphic.maven.util
Class AntPathMatcherFilter
java.lang.Object
com.isomorphic.maven.util.AntPathMatcherFilter
public class AntPathMatcherFilter extends Object
Provides a mechanism to see whether or not a String path is matched by one or more ant-style patterns.
-
Constructor Summary
Constructors Constructor Description AntPathMatcherFilter()Default constructor whose behavior is to include all files.AntPathMatcherFilter(String includes, String excludes)Allows the specification of one or more patterns for inclusion and/or exclusion. -
Method Summary
Modifier and Type Method Description booleanaccept(String path)Returns false ifpathmatches any exclusion, otherwise evaluates each inclusion ti see whether any of them match and returns true if so.AntPathMatcherFiltercopy()Copies this object's inclusions and exclusions to a new instance.AntPathMatcherFilterexclude(String patterns)Add the given patterns to the current list of exclusions.AntPathMatcherFilterinclude(String patterns)Add the given patterns to the current list of inclusions.
-
Constructor Details
-
AntPathMatcherFilter
public AntPathMatcherFilter()Default constructor whose behavior is to include all files. -
AntPathMatcherFilter
Allows the specification of one or more patterns for inclusion and/or exclusion.- Parameters:
includes- a comma-separated list of patterns to be included in matchingexcludes- a comma-separated list of patterns to be excluded from matching
-
-
Method Details
-
include
Add the given patterns to the current list of inclusions.- Parameters:
patterns- a comma-separated list of patterns to be included in matching- Returns:
- this AntPathMatcherFilter instance, in fluid interface style
-
exclude
Add the given patterns to the current list of exclusions.- Parameters:
patterns- a comma-separated list of patterns to be excluded from matching- Returns:
- this AntPathMatcherFilter instance, in fluid interface style
-
accept
Returns false ifpathmatches any exclusion, otherwise evaluates each inclusion ti see whether any of them match and returns true if so.- Parameters:
path- The path to be matched- Returns:
- true if path matches one or more inclusions and no exclusions
-
copy
Copies this object's inclusions and exclusions to a new instance.- Returns:
- a new AntPathMAtcherFilter instance with copies of this instance's inclusions and exclusions
-