Class FileFilter

  • All Implemented Interfaces:
    java.io.FileFilter

    public abstract class FileFilter
    extends javax.swing.filechooser.FileFilter
    implements java.io.FileFilter
    An abstract file filter that can be used with both file chooser APIs and File.listFiles.
    Since:
    3.0
    Author:
    Chris Jennings
    • Constructor Summary

      Constructors 
      Constructor Description
      FileFilter()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static FileFilter adapt​(java.io.FileFilter ioFilter, java.lang.String description)
      Converts an I/O file filter into a dual filter that can be used for I/O or for file choosers.
      static FileFilter adapt​(javax.swing.filechooser.FileFilter chooserFilter)
      Converts an file chooser filter into a dual filter that can be used for I/O or for file choosers.
      • Methods inherited from class javax.swing.filechooser.FileFilter

        accept, getDescription
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.io.FileFilter

        accept
    • Constructor Detail

      • FileFilter

        public FileFilter()
    • Method Detail

      • adapt

        public static FileFilter adapt​(java.io.FileFilter ioFilter,
                                       java.lang.String description)
        Converts an I/O file filter into a dual filter that can be used for I/O or for file choosers.
        Parameters:
        ioFilter - the I/O filter
        description - a description used when the filter is used in a file chooser
        Returns:
        a dual filter
      • adapt

        public static FileFilter adapt​(javax.swing.filechooser.FileFilter chooserFilter)
        Converts an file chooser filter into a dual filter that can be used for I/O or for file choosers.
        Parameters:
        chooserFilter - a file chooser filter
        Returns:
        a dual filter