Files that can be written to.
Example, showing how to print out a list of the current directory's writable files:
File dir = new File(".");
String[] files = dir.list( CanWriteFileFilter.CAN_WRITE );
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 un-writable files:
File dir = new File(".");
String[] files = dir.list( CanWriteFileFilter.CANNOT_WRITE );
for ( int i = 0; i < files.length; i++ ) {
System.out.println(files[i]);
}
N.B. For read-only files, use
CanReadFileFilter.READ_ONLY.
| Modifier and Type | Field and Description |
|---|---|
| public static final IOFileFilter | CAN_WRITE
Singleton instance of writable filter |
| public static final IOFileFilter | CANNOT_WRITE
Singleton instance of not writable filter |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the file can be
written to, otherwise false.the File to check file)Overrides org. Implements org. |
| CAN_WRITE | back to summary |
|---|---|
| public static final IOFileFilter CAN_WRITE Singleton instance of writable filter | |
| CANNOT_WRITE | back to summary |
|---|---|
| public static final IOFileFilter CANNOT_WRITE Singleton instance of not writable filter | |
| CanWriteFileFilter | back to summary |
|---|---|
| protected CanWriteFileFilter() Restrictive consructor. | |
| accept | back to summary |
|---|---|
| public boolean accept(File file) Overrides org. Implements org. Checks to see if the file can be written to.
| |