The File objects offers the possibility to read from and save to files.
Properties
Constructor
File( String path) |
|
|
|
Creates a file reference to a file at path. Creating a file reference doesn't automatically open the file. |
Methods
void close() |
|
|
|
Closes an open file. |
String[] contentOfDir() |
|
|
|
If path is an folder this function returns an array of all the files which are in the folder at path. |
Boolean copyTo( String toPath) |
|
|
|
Copies the file from path to toPath. Returns true if the operation was successful. |
String directory() |
|
|
|
Returns the directory path component of the file at path. |
Boolean exist() |
|
|
|
Return true if the the file at path already exists. Otherwise it returns false. |
String extension() |
|
|
|
Returns the file extension of the file at path. |