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]);
}
| Modifier and Type | Field and Description |
|---|---|
| public static final IOFileFilter | DIRECTORY
Singleton instance of directory filter. |
| public static final IOFileFilter | INSTANCE
Singleton instance of directory filter. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the file is a directorythe File to check file)Overrides org. Implements org. |
| DIRECTORY | back to summary |
|---|---|
| public static final IOFileFilter DIRECTORY Singleton instance of directory filter.
| |
| INSTANCE | back to summary |
|---|---|
| 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. | |
| DirectoryFileFilter | back to summary |
|---|---|
| protected DirectoryFileFilter() Restrictive consructor. | |
| accept | back to summary |
|---|---|
| public boolean accept(File file) Overrides org. Implements org. Checks to see if the file is a directory.
| |