This filter accepts File s 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]);
}
|