Class FileExtensionSelector

  • All Implemented Interfaces:
    FileSelector

    public class FileExtensionSelector
    extends java.lang.Object
    implements FileSelector
    A FileSelector that selects based on file extensions.

    The extension comparison is case insensitive.

    The selector makes a copy of a given Collection or array. Changing the object passed in the constructors will not affect the selector.

    Since:
    2.1
    • Constructor Summary

      Constructors 
      Constructor Description
      FileExtensionSelector​(java.lang.String... extensions)
      Creates a new selector for the given extensions.
      FileExtensionSelector​(java.util.Collection<java.lang.String> extensions)
      Creates a new selector for the given extensions.
    • Constructor Detail

      • FileExtensionSelector

        public FileExtensionSelector​(java.util.Collection<java.lang.String> extensions)
        Creates a new selector for the given extensions.
        Parameters:
        extensions - The extensions to be included by this selector.
      • FileExtensionSelector

        public FileExtensionSelector​(java.lang.String... extensions)
        Creates a new selector for the given extensions.
        Parameters:
        extensions - The extensions to be included by this selector.
    • Method Detail

      • includeFile

        public boolean includeFile​(FileSelectInfo fileInfo)
        Determines if a file or folder should be selected.
        Specified by:
        includeFile in interface FileSelector
        Parameters:
        fileInfo - The file selection information.
        Returns:
        true if the file should be selected, false otherwise.