Files that are hidden.
Example, showing how to print out a list of the current directory's hidden files:
File dir = new File(".");
String[] files = dir.list( HiddenFileFilter.HIDDEN );
for ( int i = 0; i < files.length; i++ ) {
System.out.println(files[i]);
}
Example, showing how to print out a list of the current directory's visible (i.e. not hidden) files:
File dir = new File(".");
String[] files = dir.list( HiddenFileFilter.VISIBLE );
for ( int i = 0; i < files.length; i++ ) {
System.out.println(files[i]);
}
| Modifier and Type | Field and Description |
|---|---|
| public static final IOFileFilter | HIDDEN
Singleton instance of hidden filter |
| public static final IOFileFilter | VISIBLE
Singleton instance of visible filter |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the file is
hidden, otherwise false.the File to check file)Overrides org. Implements org. |
| HIDDEN | back to summary |
|---|---|
| public static final IOFileFilter HIDDEN Singleton instance of hidden filter | |
| VISIBLE | back to summary |
|---|---|
| public static final IOFileFilter VISIBLE Singleton instance of visible filter | |
| HiddenFileFilter | back to summary |
|---|---|
| protected HiddenFileFilter() Restrictive consructor. | |
| accept | back to summary |
|---|---|
| public boolean accept(File file) Overrides org. Implements org. Checks to see if the file is hidden.
| |