Class PathVisitorFileFilter

  • All Implemented Interfaces:
    java.io.FileFilter, java.io.FilenameFilter, java.nio.file.FileVisitor<java.nio.file.Path>, PathFilter, PathVisitor, IOFileFilter

    public class PathVisitorFileFilter
    extends AbstractFileFilter
    A file filter backed by a path visitor.
    Since:
    2.9.0
    • Constructor Summary

      Constructors 
      Constructor Description
      PathVisitorFileFilter​(PathVisitor pathVisitor)
      Constructs a new instance that will forward calls to the given visitor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(java.io.File file)
      Checks to see if the File should be accepted by this filter.
      boolean accept​(java.io.File dir, java.lang.String name)
      Checks to see if the File should be accepted by this filter.
      java.nio.file.FileVisitResult accept​(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attributes)
      Checks to see if the Path should be accepted by this filter.
      java.nio.file.FileVisitResult visitFile​(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attributes)  
      • Methods inherited from class java.lang.Object

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

      • PathVisitorFileFilter

        public PathVisitorFileFilter​(PathVisitor pathVisitor)
        Constructs a new instance that will forward calls to the given visitor.
        Parameters:
        pathVisitor - visit me.
    • Method Detail

      • accept

        public boolean accept​(java.io.File file)
        Description copied from class: AbstractFileFilter
        Checks to see if the File should be accepted by this 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 this file matches the test
      • accept

        public boolean accept​(java.io.File dir,
                              java.lang.String name)
        Description copied from class: AbstractFileFilter
        Checks to see if the File should be accepted by this filter.
        Specified by:
        accept in interface java.io.FilenameFilter
        Specified by:
        accept in interface IOFileFilter
        Overrides:
        accept in class AbstractFileFilter
        Parameters:
        dir - the directory File to check
        name - the file name within the directory to check
        Returns:
        true if this file matches the test
      • accept

        public java.nio.file.FileVisitResult accept​(java.nio.file.Path path,
                                                    java.nio.file.attribute.BasicFileAttributes attributes)
        Description copied from interface: IOFileFilter
        Checks to see if the Path should be accepted by this filter.
        Parameters:
        path - the Path to check.
        attributes - the file's basic attributes (TODO may be null).
        Returns:
        true if this path matches the test.
      • visitFile

        public java.nio.file.FileVisitResult visitFile​(java.nio.file.Path path,
                                                       java.nio.file.attribute.BasicFileAttributes attributes)
                                                throws java.io.IOException
        Specified by:
        visitFile in interface java.nio.file.FileVisitor<java.nio.file.Path>
        Overrides:
        visitFile in class AbstractFileFilter
        Throws:
        java.io.IOException