DelegateFileFilter (Commons IO 2.5)
Date: 2016-12-01

org.apache.commons.io.filefilter

## Class DelegateFileFilter

- java.lang.Object
- - org.apache.commons.io.filefilter.AbstractFileFilter
  - - org.apache.commons.io.filefilter.DelegateFileFilter

- All Implemented Interfaces:
    java.io.FileFilter, java.io.FilenameFilter, java.io.Serializable, IOFileFilter

      public class DelegateFileFilter
      extends AbstractFileFilter
      implements java.io.Serializable

  This class turns a Java FileFilter or FilenameFilter into an IO FileFilter.
  Since:
    1.0
  Version:
    $Id: DelegateFileFilter.java 1642757 2014-12-01 21:09:30Z sebb $
  See Also:
    `FileFilterUtils.asFileFilter(FileFilter)`, `FileFilterUtils.asFileFilter(FilenameFilter)`, Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.io.FileFilter` | `fileFilter` The File filter
    `private java.io.FilenameFilter` | `filenameFilter` The Filename filter
    `private static long` | `serialVersionUID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DelegateFileFilter(java.io.FileFilter filter)` Constructs a delegate file filter around an existing FileFilter.
    `DelegateFileFilter(java.io.FilenameFilter filter)` Constructs a delegate file filter around an existing FilenameFilter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(java.io.File file)` Checks the filter.
    `boolean` | `accept(java.io.File dir, java.lang.String name)` Checks the filter.
    `java.lang.String` | `toString()` Provide a String representaion of this file filter.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### serialVersionUID

          private static final long serialVersionUID

      See Also:
        Constant Field Values

    - #### filenameFilter

          private final java.io.FilenameFilter filenameFilter

      The Filename filter

    - #### fileFilter

          private final java.io.FileFilter fileFilter

      The File filter

  - ### Constructor Detail

    - #### DelegateFileFilter

          public DelegateFileFilter(java.io.FilenameFilter filter)

      Constructs a delegate file filter around an existing FilenameFilter.
      Parameters:
        `filter` - the filter to decorate

    - #### DelegateFileFilter

          public DelegateFileFilter(java.io.FileFilter filter)

      Constructs a delegate file filter around an existing FileFilter.
      Parameters:
        `filter` - the filter to decorate

  - ### Method Detail

    - #### accept

          public boolean accept(java.io.File file)

      Checks the filter.
      Specified by:
        `accept` in interface `java.io.FileFilter`
      Specified by:
        `accept` in interface `IOFileFilter`
      Overrides:
        `accept` in class `AbstractFileFilter`
      Parameters:
        `file` - the file to check
      Returns:
        true if the filter matches

    - #### accept

          public boolean accept(java.io.File dir,
                       java.lang.String name)

      Checks the filter.
      Specified by:
        `accept` in interface `java.io.FilenameFilter`
      Specified by:
        `accept` in interface `IOFileFilter`
      Overrides:
        `accept` in class `AbstractFileFilter`
      Parameters:
        `dir` - the directory
        `name` - the filename in the directory
      Returns:
        true if the filter matches

    - #### toString

          public java.lang.String toString()

      Provide a String representaion of this file filter.
      Overrides:
        `toString` in class `AbstractFileFilter`
      Returns:
        a String representaion

Copyright (c) 2002-2016 Apache Software Foundation