Class WildcardFileFilter

    • Constructor Detail

      • WildcardFileFilter

        public WildcardFileFilter​(String wildcard)
        Construct a new case-sensitive wildcard filter for a single wildcard.
        Parameters:
        wildcard - the wildcard to match
        Throws:
        IllegalArgumentException - if the pattern is null
      • WildcardFileFilter

        public WildcardFileFilter​(String wildcard,
                                  IOCase caseSensitivity)
        Construct a new wildcard filter for a single wildcard specifying case-sensitivity.
        Parameters:
        wildcard - the wildcard to match, not null
        caseSensitivity - how to handle case sensitivity, null means case-sensitive
        Throws:
        IllegalArgumentException - if the pattern is null
    • Method Detail

      • accept

        public boolean accept​(File file)
        Checks to see if the filename matches one of the wildcards.
        Specified by:
        accept in interface FileFilter
        Parameters:
        file - the file to check
        Returns:
        true if the filename matches one of the wildcards
      • main

        public static void main​(String[] args)