NameMatcher(String pattern, Character pathSeparator, boolean dirOnly, boolean deleteBackslash) { super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); if (deleteBackslash) { pattern = Strings.deleteBackslash(pattern); } beginning = pattern.length() == 0 ? false : pattern.charAt(0) == slash; if (!beginning) { this.subPattern = pattern; } else { this.subPattern = pattern.substring(1); } }
private PathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException { super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); beginning = pattern.indexOf(slash) == 0; if (isSimplePathWithSegments(pattern)) matchers = null; else matchers = createMatchers(split(pattern, slash), pathSeparator, dirOnly); }
/** * Create path matcher * * @param pattern * a pattern * @param pathSeparator * if this parameter isn't null then this character will not * match at wildcards(* and ? are wildcards). * @param dirOnly * a boolean. * @return never null * @throws org.eclipse.jgit.errors.InvalidPatternException */ public static IMatcher createPathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException { pattern = trim(pattern); char slash = Strings.getPathSeparator(pathSeparator); // ignore possible leading and trailing slash int slashIdx = pattern.indexOf(slash, 1); if (slashIdx > 0 && slashIdx < pattern.length() - 1) return new PathMatcher(pattern, pathSeparator, dirOnly); return createNameMatcher0(pattern, pathSeparator, dirOnly, true); }
NameMatcher(String pattern, Character pathSeparator, boolean dirOnly, boolean deleteBackslash) { super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); if (deleteBackslash) { pattern = Strings.deleteBackslash(pattern); } beginning = pattern.length() == 0 ? false : pattern.charAt(0) == slash; if (!beginning) this.subPattern = pattern; else this.subPattern = pattern.substring(1); }
NameMatcher(String pattern, Character pathSeparator, boolean dirOnly, boolean deleteBackslash) { super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); if (deleteBackslash) { pattern = Strings.deleteBackslash(pattern); } beginning = pattern.length() == 0 ? false : pattern.charAt(0) == slash; if (!beginning) { this.subPattern = pattern; } else { this.subPattern = pattern.substring(1); } }
NameMatcher(String pattern, Character pathSeparator, boolean dirOnly, boolean deleteBackslash) { super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); if (deleteBackslash) { pattern = Strings.deleteBackslash(pattern); } beginning = pattern.length() == 0 ? false : pattern.charAt(0) == slash; if (!beginning) { this.subPattern = pattern; } else { this.subPattern = pattern.substring(1); } }
PathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException { super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); beginning = pattern.indexOf(slash) == 0; if (isSimplePathWithSegments(pattern)) matchers = null; else matchers = createMatchers(split(pattern, slash), pathSeparator, dirOnly); }
private PathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException { super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); beginning = pattern.indexOf(slash) == 0; if (isSimplePathWithSegments(pattern)) matchers = null; else matchers = createMatchers(split(pattern, slash), pathSeparator, dirOnly); }
private PathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException { super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); beginning = pattern.indexOf(slash) == 0; if (isSimplePathWithSegments(pattern)) matchers = null; else matchers = createMatchers(split(pattern, slash), pathSeparator, dirOnly); }
/** * * @param pattern * @param pathSeparator * if this parameter isn't null then this character will not * match at wildcards(* and ? are wildcards). * @param dirOnly * @return never null * @throws InvalidPatternException */ public static IMatcher createPathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException { pattern = trim(pattern); char slash = Strings.getPathSeparator(pathSeparator); // ignore possible leading and trailing slash int slashIdx = pattern.indexOf(slash, 1); if (slashIdx > 0 && slashIdx < pattern.length() - 1) return new PathMatcher(pattern, pathSeparator, dirOnly); return createNameMatcher0(pattern, pathSeparator, dirOnly); }
/** * Create path matcher * * @param pattern a pattern * @param pathSeparator if this parameter isn't null then this character will not * match at wildcards(* and ? are wildcards). * @param dirOnly a boolean. * @return never null * @throws org.eclipse.jgit.errors.InvalidPatternException */ public static IMatcher createPathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException { pattern = trim(pattern); char slash = Strings.getPathSeparator(pathSeparator); // ignore possible leading and trailing slash int slashIdx = pattern.indexOf(slash, 1); if (slashIdx > 0 && slashIdx < pattern.length() - 1) return new PathMatcher(pattern, pathSeparator, dirOnly); return createNameMatcher0(pattern, pathSeparator, dirOnly, true); }
/** * Create path matcher * * @param pattern * a pattern * @param pathSeparator * if this parameter isn't null then this character will not * match at wildcards(* and ? are wildcards). * @param dirOnly * a boolean. * @return never null * @throws org.eclipse.jgit.errors.InvalidPatternException */ public static IMatcher createPathMatcher(String pattern, Character pathSeparator, boolean dirOnly) throws InvalidPatternException { pattern = trim(pattern); char slash = Strings.getPathSeparator(pathSeparator); // ignore possible leading and trailing slash int slashIdx = pattern.indexOf(slash, 1); if (slashIdx > 0 && slashIdx < pattern.length() - 1) return new PathMatcher(pattern, pathSeparator, dirOnly); return createNameMatcher0(pattern, pathSeparator, dirOnly, true); }