|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.io.filefilter.AbstractFileFilter
org.apache.commons.io.filefilter.DirectoryFileFilter
public class DirectoryFileFilter
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]);
}
| Field Summary | |
|---|---|
static IOFileFilter |
DIRECTORY
Singleton instance of directory filter. |
static IOFileFilter |
INSTANCE
Singleton instance of directory filter. |
| Constructor Summary | |
|---|---|
protected |
DirectoryFileFilter()
Restrictive consructor. |
| Method Summary | |
|---|---|
boolean |
accept(File file)
Checks to see if the file is a directory. |
| Methods inherited from class org.apache.commons.io.filefilter.AbstractFileFilter |
|---|
accept, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final IOFileFilter DIRECTORY
public static final IOFileFilter INSTANCE
| Constructor Detail |
|---|
protected DirectoryFileFilter()
| Method Detail |
|---|
public boolean accept(File file)
accept in interface FileFilteraccept in interface IOFileFilteraccept in class AbstractFileFilterfile - the File to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||