IMatcher
public class PathMatcher extends AbstractMatcher
This class is immutable and thread safe.
Modifier and Type | Method | Description |
---|---|---|
static IMatcher |
createPathMatcher(String pattern,
Character pathSeparator,
boolean dirOnly) |
|
boolean |
matches(String path,
boolean assumeDirectory) |
Matches entire given string
|
boolean |
matches(String segment,
int startIncl,
int endExcl,
boolean assumeDirectory) |
Matches only part of given string
|
equals, hashCode, toString
public static IMatcher createPathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException
pattern
- pathSeparator
- if this parameter isn't null then this character will not
match at wildcards(* and ? are wildcards).dirOnly
- InvalidPatternException
public boolean matches(String path, boolean assumeDirectory)
IMatcher
path
- string which is not null, but might be emptyassumeDirectory
- true to assume this path as directory (even if it doesn't end
with a slash)public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory)
IMatcher
segment
- string which is not null, but might be emptystartIncl
- start index, inclusiveendExcl
- end index, exclusiveassumeDirectory
- true to assume this path as directory (even if it doesn't end
with a slash)Copyright © 2018. All rights reserved.