public interface Directory
| Modifier and Type | Method and Description |
|---|---|
void |
deleteAllFiles()
Deletes all files present under this directory
|
void |
deleteFile(String name)
Deletes a File.
|
boolean |
fileExists(String name)
Checks if a File exists in the directory
|
File |
getOrCreateFile(String name)
Creates a new, empty file or returns a reference to the named file if it already exists.
|
long |
getSizeInBytes()
Reports the total size of the directory
|
Set<String> |
listFiles()
Retrieves the names of files present in the directory
|
File getOrCreateFile(String name) throws IOException
name - name of the File to be createdIOException - if an error occurred while processing the request.void deleteFile(String name) throws IOException, FileNotFoundException
name - of the file to be deleted.IOException - if an I/O error occurs.FileNotFoundException - if the file is not found.boolean fileExists(String name)
name - name of the file to be checked for existence.Set<String> listFiles() throws IOException
IOException - if an error occurs while processing the request.long getSizeInBytes()
void deleteAllFiles()
throws IOException
IOException - if an I/O error occursCopyright © 2015–2024. All rights reserved.