Class NotFileFilter

    • Constructor Detail

      • NotFileFilter

        public NotFileFilter​(IOFileFilter filter)
        Constructs a new file filter that NOTs the result of another filter.
        Parameters:
        filter - the filter, must not be null
        Throws:
        java.lang.NullPointerException - if the filter is null
    • Method Detail

      • accept

        public boolean accept​(java.io.File file)
        Returns the logical NOT of the underlying filter's return value for the same File.
        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 returns false
      • accept

        public boolean accept​(java.io.File file,
                              java.lang.String name)
        Returns the logical NOT of the underlying filter's return value for the same arguments.
        Specified by:
        accept in interface java.io.FilenameFilter
        Specified by:
        accept in interface IOFileFilter
        Overrides:
        accept in class AbstractFileFilter
        Parameters:
        file - the File directory
        name - the file name
        Returns:
        true if the filter returns false
      • accept

        public java.nio.file.FileVisitResult accept​(java.nio.file.Path file,
                                                    java.nio.file.attribute.BasicFileAttributes attributes)
        Returns the logical NOT of the underlying filter's return value for the same File.
        Specified by:
        accept in interface IOFileFilter
        Specified by:
        accept in interface PathFilter
        Parameters:
        file - the File to check
        attributes - the path's basic attributes (may be null).
        Returns:
        true if the filter returns false
        Since:
        2.9.0
      • not

        private java.nio.file.FileVisitResult not​(java.nio.file.FileVisitResult accept)
      • toString

        public java.lang.String toString()
        Provide a String representation of this file filter.
        Overrides:
        toString in class AbstractFileFilter
        Returns:
        a String representation