Class PatternFilenameFilter

  • All Implemented Interfaces:

    @Beta
    @GwtIncompatible
    public final class PatternFilenameFilter
    extends 
    implements 
    File name filter that only accepts files matching a regular expression. This class is thread-safe and immutable.
    Since:
    1.0
    Author:
    Apple Chow
    • Constructor Summary

      Constructors 
      Constructor Description
       patternStr)
      Constructs a pattern file name filter object.
       pattern)
      Constructs a pattern file name filter object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean  dir,  fileName)
      Tests if a specified file should be included in a file list.
      • Methods inherited from class java.lang.

        , , , , , , , , , ,
    • Constructor Detail

      • PatternFilenameFilter

        public  patternStr)
        Constructs a pattern file name filter object.
        Parameters:
        patternStr - the pattern string on which to filter file names
        Throws:
        - if pattern compilation fails (runtime)
      • PatternFilenameFilter

        public  pattern)
        Constructs a pattern file name filter object.
        Parameters:
        pattern - the pattern on which to filter file names
    • Method Detail

      • accept

        public boolean   dir,
                               fileName)
        Description copied from interface: 
        Tests if a specified file should be included in a file list.
        Specified by:
         in interface 
        Parameters:
        dir - the directory in which the file was found.
        fileName - the name of the file.
        Returns:
        true if and only if the name should be included in the file list; false otherwise.