FileDocCategorySizeDatePackage
SimpleFilenameFilter.javaAPI DocGlassfish v2 API2707Fri May 04 22:32:08 BST 2007None

SimpleFilenameFilter

public class SimpleFilenameFilter extends Object implements FilenameFilter
Filename filter allowing files ending with the specified extensions (with period) and all directories.
author
Danny Coward

Fields Summary
private String[]
extensions
Constructors Summary
public SimpleFilenameFilter(String[] extensions)

    
       
	this.extensions = extensions;
    
Methods Summary
public booleanaccept(java.io.File pathname, java.lang.String s)

	if ( (new File(pathname, s)).isDirectory() ) {
	    return true;
	} else {
	    if (extensions == null) {
		return true;
	    }
	}
	for (int i = 0; i < extensions.length; i++) {
	    if ( s.endsWith(extensions[i]) ) {
		return true;
	    }
	}
	return false;