public class DirectoryFileFilter extends AbstractFileFilter implements java.io.Serializable
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]); }
FileFilterUtils.directoryFileFilter()
,
Serialized FormModifier and Type | Field and Description |
---|---|
static IOFileFilter |
DIRECTORY
Singleton instance of directory filter.
|
static IOFileFilter |
INSTANCE
Singleton instance of directory filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File file)
Checks to see if the file is a directory.
|
accept, toString
public static final IOFileFilter DIRECTORY
public static final IOFileFilter INSTANCE
public boolean accept(java.io.File file)
accept
in interface java.io.FileFilter
accept
in interface IOFileFilter
accept
in class AbstractFileFilter
file
- the File to checkCopyright © 2010 - 2020 Adobe. All Rights Reserved