public class DefaultPathFilter extends Object implements PathFilter
ALL, NONE| Constructor and Description |
|---|
DefaultPathFilter()
Default constructor
|
DefaultPathFilter(String pattern)
Creates a new default path filter
|
| Modifier and Type | Method and Description |
|---|---|
String |
getPattern()
Returns the pattern
|
boolean |
isAbsolute()
Checks if the pattern is absolute, i.e.
|
boolean |
matches(String path)
Checks if the given path matches this filters criteria.
|
void |
setPattern(String pattern)
Sets the regexp pattern for this filter.
|
public DefaultPathFilter()
public DefaultPathFilter(String pattern)
pattern - the patternsetPattern(java.lang.String)public void setPattern(String pattern)
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
pattern - the pattern.public String getPattern()
public boolean matches(String path)
matches in interface PathFilterpath - the path to checktrue if this filter matches the criteria;
false otherwise.public boolean isAbsolute()
isAbsolute in interface PathFiltertrue if pattern is absoluteCopyright © 2017 The Apache Software Foundation. All rights reserved.