Class RegexPathFilter

java.lang.Object
com.ganteater.ae.util.RegexPathFilter
All Implemented Interfaces:
FileFilter, FilenameFilter, PathMatcher, PathFilter, IOFileFilter

public class RegexPathFilter extends Object implements IOFileFilter
  • Constructor Details

    • RegexPathFilter

      public RegexPathFilter(String fileFilterRegex, String dirFilterRegex)
      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

      public boolean accept(File file)
      This method is called by FileUtils.listFiles when checking a file's directory. The `file` parameter is the directory being scanned.
      Specified by:
      accept in interface FileFilter
      Specified by:
      accept in interface IOFileFilter
      Parameters:
      file - The directory to check.
      Returns:
      true if the directory's full path matches the regex, false otherwise.
    • accept

      public boolean accept(File dir, String name)
      Specified by:
      accept in interface FilenameFilter
      Specified by:
      accept in interface IOFileFilter