/** * Compile glob pattern string * @param globPattern the glob pattern * @return the pattern object */ public static Pattern compile(String globPattern) { return new GlobPattern(globPattern).compiled(); }
void init(String filePattern, PathFilter filter) throws IOException { try { userFilter = filter; pattern = new GlobPattern(filePattern); } catch (PatternSyntaxException e) { // Existing code expects IOException startWith("Illegal file pattern") throw new IOException("Illegal file pattern: "+ e.getMessage(), e); } }
@Override public void prepare() throws IOException { String argPattern = getArgument(1); if (!caseSensitive) { argPattern = StringUtils.toLowerCase(argPattern); } globPattern = new GlobPattern(argPattern); }
/** * 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); }
void init(String filePattern, PathFilter filter) throws IOException { try { userFilter = filter; pattern = new GlobPattern(filePattern); } catch (PatternSyntaxException e) { // Existing code expects IOException startWith("Illegal file pattern") throw new IOException("Illegal file pattern: "+ e.getMessage(), e); } }
void init(String filePattern, PathFilter filter) throws IOException { try { userFilter = filter; pattern = new GlobPattern(filePattern); } catch (PatternSyntaxException e) { // Existing code expects IOException startWith("Illegal file pattern") throw new IOException("Illegal file pattern: "+ e.getMessage(), e); } }
void init(String filePattern, PathFilter filter) throws IOException { try { userFilter = filter; pattern = new GlobPattern(filePattern); } catch (PatternSyntaxException e) { // Existing code expects IOException startWith("Illegal file pattern") throw new IOException("Illegal file pattern: "+ e.getMessage(), e); } }
void init(String filePattern, PathFilter filter) throws IOException { try { userFilter = filter; pattern = new GlobPattern(filePattern); } catch (PatternSyntaxException e) { // Existing code expects IOException startWith("Illegal file pattern") throw new IOException("Illegal file pattern: "+ e.getMessage(), e); } }
/** * Compile glob pattern string * @param globPattern the glob pattern * @return the pattern object */ public static Pattern compile(String globPattern) { return new GlobPattern(globPattern).compiled(); }
/** * Compile glob pattern string * @param globPattern the glob pattern * @return the pattern object */ public static Pattern compile(String globPattern) { return new GlobPattern(globPattern).compiled(); }
/** * Compile glob pattern string * @param globPattern the glob pattern * @return the pattern object */ public static Pattern compile(String globPattern) { return new GlobPattern(globPattern).compiled(); }
/** {@inheritDoc} */ @Override public void initialise(FindOptions options) { String argPattern = getArguments().get(0); if(!caseSensitive) { argPattern = argPattern.toLowerCase(); } globPattern = new GlobPattern(argPattern); }
/** * Compile glob pattern string * * @param globPattern the glob pattern * @return the pattern object */ public static Pattern compile(String globPattern) { return new GlobPattern(globPattern).compiled(); }
@Override public void prepare() throws IOException { String argPattern = getArgument(1); if (!caseSensitive) { argPattern = StringUtils.toLowerCase(argPattern); } globPattern = new GlobPattern(argPattern); }
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); } }
@Override public void prepare() throws IOException { String argPattern = getArgument(1); if (!caseSensitive) { argPattern = StringUtils.toLowerCase(argPattern); } globPattern = new GlobPattern(argPattern); }
@Override public void prepare() throws IOException { String argPattern = getArgument(1); if (!caseSensitive) { argPattern = StringUtils.toLowerCase(argPattern); } globPattern = new GlobPattern(argPattern); }
@Override public void prepare() throws IOException { String argPattern = getArgument(1); if (!caseSensitive) { argPattern = StringUtils.toLowerCase(argPattern); } globPattern = new GlobPattern(argPattern); }
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); } }