java.lang.Object
org.eclipse.jgit.ignore.internal.AbstractMatcher
org.eclipse.jgit.ignore.internal.PathMatcher
- All Implemented Interfaces:
IMatcher
Matcher built by patterns consists of multiple path segments.
This class is immutable and thread safe.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IMatchercreatePathMatcher(String pattern, Character pathSeparator, boolean dirOnly) Create path matcherbooleanMatches entire given stringbooleanMatches only part of given stringMethods inherited from class org.eclipse.jgit.ignore.internal.AbstractMatcher
equals, hashCode, toString
-
Method Details
-
createPathMatcher
public static IMatcher createPathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException Create path matcher- Parameters:
pattern- a patternpathSeparator- if this parameter isn't null then this character will not match at wildcards(* and ? are wildcards).dirOnly- a boolean.- Returns:
- never null
- Throws:
InvalidPatternException
-
matches
Matches entire given string- Parameters:
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)pathMatch-trueif the match is for the full path: prefix-only matches are not allowed- Returns:
- true if this matcher pattern matches given string
-
matches
Matches only part of given string- Parameters:
segment- string which is not null, but might be emptystartIncl- start index, inclusiveendExcl- end index, exclusive- Returns:
- true if this matcher pattern matches given string
-