net.sf.okapi.common

## Class DefaultFilenameFilter

- java.lang.Object
- - net.sf.okapi.common.DefaultFilenameFilter

- All Implemented Interfaces:
    java.io.FilenameFilter

      public class DefaultFilenameFilter
      extends java.lang.Object
      implements java.io.FilenameFilter

  Implements a default filename filter that supports filtering by wild-cards like ("myFile*.*").

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultFilenameFilter(java.lang.String extension)` Creates a new DefaultFilenameFilter object with a given extension value.
    `DefaultFilenameFilter(java.lang.String pattern, boolean caseSensitive)` Creates a new DefaultFilenameFilter object for a given pattern.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(java.io.File directory, java.lang.String fileName)` Accept or reject a given filename.

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

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

- - ### Constructor Detail

    - #### DefaultFilenameFilter

          public DefaultFilenameFilter(java.lang.String pattern,
                                       boolean caseSensitive)

      Creates a new DefaultFilenameFilter object for a given pattern.
      Parameters:
        `pattern` - to filter on.
        `caseSensitive` - true to use case-sensitive pattern, false otherwise. You can use ? to match any single character and * to match any multiple characters. The pattern is not case-sensitive ("test.*" and "TeSt.*" give the same results) except if specified otherwise.

    - #### DefaultFilenameFilter

          public DefaultFilenameFilter(java.lang.String extension)

      Creates a new DefaultFilenameFilter object with a given extension value. This constructor is for backward compatibility and is equivalent to calling `DefaultFilenameFilter("*"+extension, false)`
      Parameters:
        `extension` - the extension to filter on.

  - ### Method Detail

    - #### accept

          public boolean accept(java.io.File directory,
                                java.lang.String fileName)

      Accept or reject a given filename.
      Specified by:
        `accept` in interface `java.io.FilenameFilter`
      Returns:
        true if the filename is accepted. If the value is null, the method returns false.