Package com.ganteater.ae.util
Class RegexPathFilter
java.lang.Object
com.ganteater.ae.util.RegexPathFilter
- All Implemented Interfaces:
FileFilter,FilenameFilter,PathMatcher,org.apache.commons.io.file.PathFilter,org.apache.commons.io.filefilter.IOFileFilter
public class RegexPathFilter
extends Object
implements org.apache.commons.io.filefilter.IOFileFilter
-
Field Summary
Fields inherited from interface org.apache.commons.io.filefilter.IOFileFilter
EMPTY_STRING_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionRegexPathFilter(String fileFilterRegex, String dirFilterRegex) Constructor to compile the regex pattern. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.io.filefilter.IOFileFilter
accept, and, matches, negate, or
-
Constructor Details
-
RegexPathFilter
Constructor to compile the regex pattern.- Parameters:
fileFilterRegex- The regular expression to match against the file name.dirFilterRegex- The regular expression to match against the full path.fileFilterRegex-
-
-
Method Details
-
accept
This method is called by FileUtils.listFiles when checking a file's directory. The `file` parameter is the directory being scanned.- Specified by:
acceptin interfaceFileFilter- Specified by:
acceptin interfaceorg.apache.commons.io.filefilter.IOFileFilter- Parameters:
file- The directory to check.- Returns:
- true if the directory's full path matches the regex, false otherwise.
-
accept
- Specified by:
acceptin interfaceFilenameFilter- Specified by:
acceptin interfaceorg.apache.commons.io.filefilter.IOFileFilter
-