FileDocCategorySizeDatePackage
DirectoryFileFilter.javaAPI DocAndroid 1.5 API2420Wed May 06 22:42:46 BST 2009org.apache.commons.io.filefilter

DirectoryFileFilter

public class DirectoryFileFilter extends AbstractFileFilter implements Serializable
This filter accepts Files that are directories.

For example, here is how to print out a list of the current directory's subdirectories:

File dir = new File(".");
String[] files = dir.list( DirectoryFileFilter.INSTANCE );
for ( int i = 0; i < files.length; i++ ) {
System.out.println(files[i]);
}
since
Commons IO 1.0
version
$Revision: 587916 $ $Date: 2007-10-24 16:53:07 +0100 (Wed, 24 Oct 2007) $
author
Stephen Colebourne
author
Peter Donald

Fields Summary
public static final IOFileFilter
DIRECTORY
Singleton instance of directory filter.
public static final IOFileFilter
INSTANCE
Singleton instance of directory filter. Please use the identical DirectoryFileFilter.DIRECTORY constant. The new name is more JDK 1.5 friendly as it doesn't clash with other values when using static imports.
Constructors Summary
protected DirectoryFileFilter()
Restrictive consructor.


           
      
    
Methods Summary
public booleanaccept(java.io.File file)
Checks to see if the file is a directory.

param
file the File to check
return
true if the file is a directory

        return file.isDirectory();