public class FileUtil extends Object
| Constructor and Description |
|---|
FileUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
createEmptyFile(File file)
Creates a new empty file
|
static File |
findFile(String fileName)
Tries to open the file from its absolute or relative path.
|
static List<String> |
getLinesFromFile(File file)
Reads all lines from a text file and adds them to a
List. |
public static List<String> getLinesFromFile(File file)
List.file - the input fileList with the file linespublic static File findFile(String fileName) throws FileNotFoundException
getResource.
Throws a FileNotFoundException if the file cannot be found.fileName - the file nameFileNotFoundException - if the cannot be foundpublic static void createEmptyFile(File file)
file - Copyright © 2003–2018. All rights reserved.