Class RegexFileScanner

  • All Implemented Interfaces:
    FileScanner

    public class RegexFileScanner
    extends Object
    implements FileScanner
    File scanner which uses regular expressions to match files.
    Since:
    1.2
    • Constructor Detail

      • RegexFileScanner

        public RegexFileScanner()
        Constructs a new instance.
        Since:
        1.2
      • RegexFileScanner

        public RegexFileScanner​(Log logger)
        Constructs a new instance.
        Parameters:
        logger - the logger used to log included/excluded files (only in debug mode).
        Since:
        1.2
    • Method Detail

      • getFiles

        public Collection<File> getFiles​(File directory,
                                         String[] includes,
                                         String[] excludes)
        Returns files contained by a directory. You must use '/' as path separator in include/exclude patterns.
        Specified by:
        getFiles in interface FileScanner
        Parameters:
        directory - the directory to be scanned.
        includes - an array of include patterns.
        excludes - an array of exclude patterns
        Returns:
        files contained by a directory.
      • createFileFilter

        protected IOFileFilter createFileFilter​(File directory,
                                                String[] includes,
                                                String[] excludes)
        Creates a IOFileFilter which will be used to find all files whose match filters.
        Parameters:
        directory - the directory to be scanned.
        includes - an array of include patterns.
        excludes - an array of exclude patterns
        Returns:
        an instance of the IOFileFilter.
        Since:
        1.3.0