org.apache.jmeter.gui

## Class JMeterFileFilter

- java.lang.Object
- - javax.swing.filechooser.FileFilter
  - - org.apache.jmeter.gui.JMeterFileFilter

- All Implemented Interfaces:
    java.io.FileFilter

      public class JMeterFileFilter
      extends javax.swing.filechooser.FileFilter
      implements java.io.FileFilter

  A file filter which allows files to be filtered based on a list of allowed extensions. Optionally returns directories.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JMeterFileFilter(java.lang.String[] extensions)` Create a new JMeter file filter which allows the specified extensions.
    `JMeterFileFilter(java.lang.String[] extensions, boolean allow)` Create a new JMeter file filter which allows the specified extensions.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(java.io.File f)` Determine if the specified file is allowed by this filter.
    `boolean` | `accept(java.lang.String filename)` Determine if the specified filename is allowed by this filter.
    `java.lang.String` | `getDescription()` Get a description for this filter.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JMeterFileFilter

          public JMeterFileFilter(java.lang.String[] extensions)

      Create a new JMeter file filter which allows the specified extensions. If the array of extensions contains no elements, any file will be allowed. This constructor will also return all directories
      Parameters:
        `extensions` - non-null array of allowed file extensions

    - #### JMeterFileFilter

          public JMeterFileFilter(java.lang.String[] extensions,
                                  boolean allow)

      Create a new JMeter file filter which allows the specified extensions. If the array of extensions contains no elements, any file will be allowed.
      Parameters:
        `extensions` - non-null array of allowed file extensions
        `allow` - should directories be returned ?

  - ### Method Detail

    - #### accept

          public boolean accept(java.io.File f)

      Determine if the specified file is allowed by this filter. The file will be allowed if it is a directory, or if the end of the filename matches one of the extensions allowed by this filter. The filename is converted to lower-case before making the comparison.
      Specified by:
        `accept` in interface `java.io.FileFilter`
      Specified by:
        `accept` in class `javax.swing.filechooser.FileFilter`
      Parameters:
        `f` - the File being tested
      Returns:
        true if the file should be allowed, false otherwise

    - #### accept

          public boolean accept(java.lang.String filename)

      Determine if the specified filename is allowed by this filter. The file will be allowed if the end of the filename matches one of the extensions allowed by this filter. The comparison is case-sensitive. If no extensions were provided for this filter, the file will always be allowed.
      Parameters:
        `filename` - the filename to test
      Returns:
        true if the file should be allowed, false otherwise

    - #### getDescription

          public java.lang.String getDescription()

      Get a description for this filter.
      Specified by:
        `getDescription` in class `javax.swing.filechooser.FileFilter`
      Returns:
        a description for this filter

Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.