jodd.io.filter.WildcardFileFilter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jodd-core Show documentation
Show all versions of jodd-core Show documentation
Jodd Core tools and utilities, including type converters, JDateTime, cache etc.
// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.
package jodd.io.filter;
import java.io.File;
import jodd.util.Wildcard;
/**
* FileFilter
that matches file names against
* {@link Wildcard#matchPath(String, String) wildcard} pattern (*, ? and **).
*/
public class WildcardFileFilter extends FileFilterBase {
private final String pattern;
/**
* Wildcard file filter.
*/
public WildcardFileFilter(String pattern) {
this.pattern = pattern;
}
@Override
public boolean accept(File dir, String name) {
return Wildcard.matchPath(name, pattern);
}
}