Class AbstractFileFilter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.nio.file.FileVisitResult onAccept
      What to do when this filter accepts.
      private java.nio.file.FileVisitResult onReject
      What to do when this filter rejects.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        AbstractFileFilter()
      Constructs a new instance.
      protected AbstractFileFilter​(java.nio.file.FileVisitResult onAccept, java.nio.file.FileVisitResult onReject)
      Constructs a new instance.
    • Method Summary

      All Methods Static 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.
      (package private) void append​(java.lang.Object[] array, java.lang.StringBuilder buffer)  
      (package private) void append​(java.util.List<?> list, java.lang.StringBuilder buffer)  
      (package private) java.nio.file.FileVisitResult get​(IOSupplier<java.nio.file.FileVisitResult> supplier)  
      protected java.nio.file.FileVisitResult handle​(java.lang.Throwable t)
      Handles exceptions caught while accepting.
      java.nio.file.FileVisitResult postVisitDirectory​(java.nio.file.Path dir, java.io.IOException exc)  
      java.nio.file.FileVisitResult preVisitDirectory​(java.nio.file.Path dir, java.nio.file.attribute.BasicFileAttributes attributes)  
      (package private) static java.nio.file.FileVisitResult toDefaultFileVisitResult​(boolean accept)  
      (package private) java.nio.file.FileVisitResult toFileVisitResult​(boolean accept)
      Converts a boolean into a FileVisitResult.
      java.lang.String toString()
      Provides a String representation of this file filter.
      java.nio.file.FileVisitResult visitFile​(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attributes)  
      java.nio.file.FileVisitResult visitFileFailed​(java.nio.file.Path file, java.io.IOException exc)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • onAccept

        private final java.nio.file.FileVisitResult onAccept
        What to do when this filter accepts.
      • onReject

        private final java.nio.file.FileVisitResult onReject
        What to do when this filter rejects.
    • Constructor Detail

      • AbstractFileFilter

        public AbstractFileFilter()
        Constructs a new instance.
      • AbstractFileFilter

        protected AbstractFileFilter​(java.nio.file.FileVisitResult onAccept,
                                     java.nio.file.FileVisitResult onReject)
        Constructs a new instance.
        Parameters:
        onAccept - What to do on acceptance.
        onReject - What to do on rejection.
        Since:
        2.12.0.
    • Method Detail

      • toDefaultFileVisitResult

        static java.nio.file.FileVisitResult toDefaultFileVisitResult​(boolean accept)
      • accept

        public boolean accept​(java.io.File file)
        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
        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)
        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
        Parameters:
        dir - the directory File to check
        name - the file name within the directory to check
        Returns:
        true if this file matches the test
      • append

        void append​(java.util.List<?> list,
                    java.lang.StringBuilder buffer)
      • append

        void append​(java.lang.Object[] array,
                    java.lang.StringBuilder buffer)
      • get

        java.nio.file.FileVisitResult get​(IOSupplier<java.nio.file.FileVisitResult> supplier)
      • handle

        protected java.nio.file.FileVisitResult handle​(java.lang.Throwable t)
        Handles exceptions caught while accepting.
        Parameters:
        t - the caught Throwable.
        Returns:
        the given Throwable.
        Since:
        2.9.0
      • postVisitDirectory

        public java.nio.file.FileVisitResult postVisitDirectory​(java.nio.file.Path dir,
                                                                java.io.IOException exc)
                                                         throws java.io.IOException
        Specified by:
        postVisitDirectory in interface java.nio.file.FileVisitor<java.nio.file.Path>
        Throws:
        java.io.IOException
      • preVisitDirectory

        public java.nio.file.FileVisitResult preVisitDirectory​(java.nio.file.Path dir,
                                                               java.nio.file.attribute.BasicFileAttributes attributes)
                                                        throws java.io.IOException
        Specified by:
        preVisitDirectory in interface java.nio.file.FileVisitor<java.nio.file.Path>
        Throws:
        java.io.IOException
      • toFileVisitResult

        java.nio.file.FileVisitResult toFileVisitResult​(boolean accept)
        Converts a boolean into a FileVisitResult.
        Parameters:
        accept - accepted or rejected.
        Returns:
        a FileVisitResult.
      • toString

        public java.lang.String toString()
        Provides a String representation of this file filter.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation
      • visitFile

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

        public java.nio.file.FileVisitResult visitFileFailed​(java.nio.file.Path file,
                                                             java.io.IOException exc)
                                                      throws java.io.IOException
        Specified by:
        visitFileFailed in interface java.nio.file.FileVisitor<java.nio.file.Path>
        Throws:
        java.io.IOException