Class AndFileFilter

  • All Implemented Interfaces:
    java.io.Serializable, FileFilter, ConditionalFileFilter

    public class AndFileFilter
    extends java.lang.Object
    implements FileFilter, ConditionalFileFilter, java.io.Serializable
    A filter providing conditional AND logic across a list of file filters. This filter returns true if all filters in the list return true. Otherwise, it returns false. Checking of the file filter list stops when the first filter returns false.
    Since:
    2.4
    Author:
    This code was originally ported from Apache Commons IO File Filter
    See Also:
    "https://commons.apache.org/proper/commons-io/", Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AndFileFilter()
      Default constructor.
      AndFileFilter​(java.util.List<FileFilter> fileFilters)
      Constructs a new instance of AndFileFilter with the specified list of filters.
      AndFileFilter​(FileFilter... filters)
      Constructs a new file filter that ANDs the result of other filters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(FileSelectInfo fileSelectInfo)
      Determines if a file or folder should be selected.
      void addFileFilter​(FileFilter fileFilter)
      Adds the specified file filter to the list of file filters at the end of the list.
      java.util.List<FileFilter> getFileFilters()
      Returns this conditional file filter's list of file filters.
      boolean removeFileFilter​(FileFilter fileFilter)
      Removes the specified file filter.
      void setFileFilters​(java.util.List<FileFilter> fileFilters)
      Sets the list of file filters, replacing any previously configured file filters on this filter.
      java.lang.String toString()
      Provide a String representation of this file filter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AndFileFilter

        public AndFileFilter​(FileFilter... filters)
        Constructs a new file filter that ANDs the result of other filters.
        Parameters:
        filters - array of filters, must not be null or empty
      • AndFileFilter

        public AndFileFilter​(java.util.List<FileFilter> fileFilters)
        Constructs a new instance of AndFileFilter with the specified list of filters.
        Parameters:
        fileFilters - a List of FileFilter instances, copied, null ignored