Class AndFileFilter

java.lang.Object
org.apache.commons.io.filefilter.AbstractFileFilter
org.apache.commons.io.filefilter.AndFileFilter
All Implemented Interfaces:
FileFilter, FilenameFilter, Serializable, FileVisitor<Path>, PathFilter, PathVisitor, ConditionalFileFilter, IOFileFilter

A FileFilter 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:
1.0
See Also:
  • Constructor Details

    • AndFileFilter

      public AndFileFilter()
      Constructs a new empty instance.
      Since:
      1.1
    • AndFileFilter

      public AndFileFilter(IOFileFilter filter1, IOFileFilter filter2)
      Constructs a new file filter that ANDs the result of other filters.
      Parameters:
      filter1 - the first filter, must second be null
      filter2 - the first filter, must not be null
      Throws:
      IllegalArgumentException - if either filter is null
    • AndFileFilter

      public AndFileFilter(IOFileFilter... fileFilters)
      Constructs a new instance for the give filters.
      Parameters:
      fileFilters - filters to OR.
      Since:
      2.9.0
    • AndFileFilter

      public AndFileFilter(List<IOFileFilter> fileFilters)
      Constructs a new instance of AndFileFilter with the specified list of filters.
      Parameters:
      fileFilters - a List of IOFileFilter instances, copied.
      Since:
      1.1
  • Method Details