FileDocCategorySizeDatePackage
SimpleFileFilter.javaAPI DocExample1244Thu Oct 24 20:14:24 BST 2002None

SimpleFileFilter

public class SimpleFileFilter extends FileFilter

Fields Summary
String[]
extensions
String
description
Constructors Summary
public SimpleFileFilter(String ext)

    this (new String[] {ext}, null);
  
public SimpleFileFilter(String[] exts, String descr)

    // Clone and lowercase the extensions
    extensions = new String[exts.length];
    for (int i = exts.length - 1; i >= 0; i--) {
      extensions[i] = exts[i].toLowerCase();
    }
    // Make sure we have a valid (if simplistic) description
    description = (descr == null ? exts[0] + " files" : descr);
  
Methods Summary
public booleanaccept(java.io.File f)

    // We always allow directories, regardless of their extension
    if (f.isDirectory()) { return true; }

    // Ok, itâ