This filter accepts File s that are directories.
Eg., here is how to print out a list of the current directory's subdirectories:
File dir = new File(".");
String[] files = dir.list( new DirectoryFileFilter() );
for ( int i=0; i<files.length; i++ )
{
System.out.println(files[i]);
}
|