public class Files extends Object
| Constructor and Description |
|---|
Files() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeFile()
Closes any open files.
|
static void |
makeFile(String path)
Makes a file
|
static void |
makeFolder(String path)
Makes a folder
|
static void |
openFileForReading(String path)
Opens a file in READ mode.
|
static void |
openFileForWriting(String path,
boolean append)
Opens a file in WRITE mode.
|
static String |
readLine()
Reads a line of a READ-MODE file.
|
static void |
trashFile(String path)
Trashes a file or folder.
|
static void |
writeLine(String line)
Writes a line to a WRITE-MODE file.
|
public static void openFileForReading(String path)
readLine() will not work.path - The path of the file to read.public static void openFileForWriting(String path, boolean append)
writeLine(String) will not work.path - Path of the file to write.append - If we should append to the file. If true, new lines will be added. If false, the file will be replaced.public static void closeFile()
public static String readLine()
openFileForReading(String) or this will not work.public static void writeLine(String line)
openFileForWriting(String, boolean) or this will not work.line - What to write to the file.public static void makeFile(String path)
path - Where to create this filepublic static void makeFolder(String path)
path - Where to create this filepublic static void trashFile(String path)
path - Path of the file to trashCopyright © 2022. All rights reserved.