@Override public boolean accept(Path path) { return pattern.matches(path.getName()) && userFilter.accept(path); } }
@Override public Result apply(PathData item, int depth) throws IOException { String name = getPath(item).getName(); if (!caseSensitive) { name = StringUtils.toLowerCase(name); } if (globPattern.matches(name)) { return Result.PASS; } else { return Result.FAIL; } }
/** * A helper to determine if the path description of this {@link DatasetDescriptor} is a superset of paths * accepted by the other {@link DatasetDescriptor}. If the path description of the other {@link DatasetDescriptor} * is a glob pattern, we return false. * * @param otherPath a glob pattern that describes a set of paths. * @return true if the glob pattern described by the otherPath matches the path in this {@link DatasetDescriptor}. */ private boolean isPathContaining(String otherPath) { if (otherPath == null) { return false; } if (DatasetDescriptorConfigKeys.DATASET_DESCRIPTOR_CONFIG_ANY.equals(this.getPath())) { return true; } if (PathUtils.isGlob(new Path(otherPath))) { return false; } GlobPattern globPattern = new GlobPattern(this.getPath()); return globPattern.matches(otherPath); }
@Override public boolean accept(Path path) { return pattern.matches(path.getName()) && userFilter.accept(path); } }
@Override public boolean accept(Path path) { return pattern.matches(path.getName()) && userFilter.accept(path); } }
@Override public boolean accept(Path path) { return pattern.matches(path.getName()) && userFilter.accept(path); } }
@Override public boolean accept(Path path) { return pattern.matches(path.getName()) && userFilter.accept(path); } }
@Override public Result apply(PathData item) { String name = getPath(item).getName(); if(!caseSensitive) { name = name.toLowerCase(); } if(globPattern.matches(name)) { return Result.PASS; } else { return Result.FAIL; } } /** Registers this expression with the specified factory. */
@Override public Result apply(PathData item, int depth) throws IOException { String name = getPath(item).getName(); if (!caseSensitive) { name = StringUtils.toLowerCase(name); } if (globPattern.matches(name)) { return Result.PASS; } else { return Result.FAIL; } }
@Override public Result apply(PathData item, int depth) throws IOException { String name = getPath(item).getName(); if (!caseSensitive) { name = StringUtils.toLowerCase(name); } if (globPattern.matches(name)) { return Result.PASS; } else { return Result.FAIL; } }
@Override public Result apply(PathData item, int depth) throws IOException { String name = getPath(item).getName(); if (!caseSensitive) { name = StringUtils.toLowerCase(name); } if (globPattern.matches(name)) { return Result.PASS; } else { return Result.FAIL; } }
@Override public Result apply(PathData item, int depth) throws IOException { String name = getPath(item).getName(); if (!caseSensitive) { name = StringUtils.toLowerCase(name); } if (globPattern.matches(name)) { return Result.PASS; } else { return Result.FAIL; } }
private void assertMatch(boolean yes, String glob, String...input) { GlobPattern pattern = new GlobPattern(glob); for (String s : input) { boolean result = pattern.matches(s); assertTrue(glob +" should"+ (yes ? "" : " not") +" match "+ s, yes ? result : !result); } }
/** * A helper to determine if the path description of this {@link DatasetDescriptor} is a superset of paths * accepted by the other {@link DatasetDescriptor}. If the path description of the other {@link DatasetDescriptor} * is a glob pattern, we return false. * * @param otherPath a glob pattern that describes a set of paths. * @return true if the glob pattern described by the otherPath matches the path in this {@link DatasetDescriptor}. */ private boolean isPathContaining(String otherPath) { if (otherPath == null) { return false; } if (DatasetDescriptorConfigKeys.DATASET_DESCRIPTOR_CONFIG_ANY.equals(this.getPath())) { return true; } if (PathUtils.isGlob(new Path(otherPath))) { return false; } GlobPattern globPattern = new GlobPattern(this.getPath()); return globPattern.matches(otherPath); }
private void assertMatch(boolean yes, String glob, String...input) { GlobPattern pattern = new GlobPattern(glob); for (String s : input) { boolean result = pattern.matches(s); assertTrue(glob +" should"+ (yes ? "" : " not") +" match "+ s, yes ? result : !result); } }
private void assertMatch(boolean yes, String glob, String...input) { GlobPattern pattern = new GlobPattern(glob); for (String s : input) { boolean result = pattern.matches(s); assertTrue(glob +" should"+ (yes ? "" : " not") +" match "+ s, yes ? result : !result); } }