Class DirectoryStreamFilter

  • All Implemented Interfaces:
    java.nio.file.DirectoryStream.Filter<java.nio.file.Path>

    public class DirectoryStreamFilter
    extends java.lang.Object
    implements java.nio.file.DirectoryStream.Filter<java.nio.file.Path>
    A DirectoryStream.Filter that delegates to a PathFilter.

    You pass this filter to Files#newDirectoryStream(Path, DirectoryStream.Filter).

    Since:
    2.9.0
    • Constructor Summary

      Constructors 
      Constructor Description
      DirectoryStreamFilter​(PathFilter pathFilter)
      Constructs a new instance for the given path filter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(java.nio.file.Path path)  
      PathFilter getPathFilter()
      Gets the path filter.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DirectoryStreamFilter

        public DirectoryStreamFilter​(PathFilter pathFilter)
        Constructs a new instance for the given path filter.
        Parameters:
        pathFilter - How to filter paths.
    • Method Detail

      • accept

        public boolean accept​(java.nio.file.Path path)
                       throws java.io.IOException
        Specified by:
        accept in interface java.nio.file.DirectoryStream.Filter<java.nio.file.Path>
        Throws:
        java.io.IOException
      • getPathFilter

        public PathFilter getPathFilter()
        Gets the path filter.
        Returns:
        the path filter.