Class FilesystemFilter

    • Constructor Detail

      • FilesystemFilter

        public FilesystemFilter​(String fileext,
                                String descr)
        Creates a new filter.
        Parameters:
        fileext - the file extension.
        descr - the description.
      • FilesystemFilter

        public FilesystemFilter​(String fileext,
                                String descr,
                                boolean accDirs)
        Creates a new filter.
        Parameters:
        fileext - the file extension.
        descr - the description.
        accDirs - accept directories?
      • FilesystemFilter

        public FilesystemFilter​(String[] fileext,
                                String descr,
                                boolean accDirs)
        Creates a new filter.
        Parameters:
        fileext - the file extension.
        descr - the description.
        accDirs - accept directories?
        Throws:
        NullPointerException - if the file extensions are null.
    • Method Detail

      • accept

        public boolean accept​(File dir,
                              String name)
        Returns true if the file is accepted, and false otherwise.
        Specified by:
        accept in interface FilenameFilter
        Parameters:
        dir - the directory.
        name - the file name.
        Returns:
        A boolean.
      • accept

        public boolean accept​(File dir)
        Returns true if the specified file matches the requirements of this filter, and false otherwise.
        Specified by:
        accept in class FileFilter
        Parameters:
        dir - the file or directory.
        Returns:
        A boolean.
      • getDescription

        public String getDescription()
        Returns the filter description.
        Specified by:
        getDescription in class FileFilter
        Returns:
        The filter description.
      • acceptDirectories

        public void acceptDirectories​(boolean b)
        Sets the flag that controls whether or not the filter accepts directories.
        Parameters:
        b - a boolean.
      • acceptsDirectories

        public boolean acceptsDirectories()
        Returns the flag that indicates whether or not the filter accepts directories.
        Returns:
        A boolean.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object