org.apache.commons.io.filefilter

## Class PathMatcherFileFilter

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

- All Implemented Interfaces:
    FileFilter, FilenameFilter, FileVisitor<Path>, PathMatcher, PathFilter, PathVisitor, IOFileFilter

      public class PathMatcherFileFilter
      extends AbstractFileFilter

  Delegates matching to a `PathMatcher`.

- - ### Field Summary

    - ### Fields inherited from interface org.apache.commons.io.filefilter.IOFileFilter

      `EMPTY_STRING_ARRAY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PathMatcherFileFilter(PathMatcher pathMatcher)` Constructs a new instance to perform matching with a PathMatcher.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(File file)` Tests to see if the File should be accepted by this filter.
    `boolean` | `matches(Path path)` Tests if a Path should be accepted by this filter.

    - ### Methods inherited from class org.apache.commons.io.filefilter.AbstractFileFilter

      `accept, append, append, get, handle, isDirectory, isFile, postVisitDirectory, preVisitDirectory, toDefaultFileVisitResult, toFileVisitResult, toString, visitFile, visitFileFailed`

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

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

    - ### Methods inherited from interface org.apache.commons.io.filefilter.IOFileFilter

      `accept, and, negate, or`

- - ### Constructor Detail

    - #### PathMatcherFileFilter

          public PathMatcherFileFilter(PathMatcher pathMatcher)

      Constructs a new instance to perform matching with a PathMatcher.
      Parameters:
        `pathMatcher` - The PathMatcher delegate.

  - ### Method Detail

    - #### accept

          public boolean accept(File file)

      Description copied from class: `AbstractFileFilter`
      Tests to see if the File should be accepted by this filter.
      Specified by:
        `accept` in interface `FileFilter`
      Specified by:
        `accept` in interface `IOFileFilter`
      Overrides:
        `accept` in class `AbstractFileFilter`
      Parameters:
        `file` - the File to check
      Returns:
        true if this file matches the test

    - #### matches

          public boolean matches(Path path)

      Description copied from interface: `IOFileFilter`
      Tests if a Path should be accepted by this filter.
      Parameters:
        `path` - the Path to check.
      Returns:
        true if this path matches the test.