public final class FileReadingUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static List<String> |
readFileLines(File file)
Reads the complete contents of a file into a list of lines.
|
static String |
readFirstFileLine(File file)
Reads the first line of a file into a string.
|
public static List<String> readFileLines(File file) throws IOException
IOException
.file
- file to readIOException
- any error reading the filepublic static String readFirstFileLine(File file) throws IOException
IOException
.
This method is not intended for large files since all lines are read into
memory before selecting the first linefile
- file to readIOException
- any error reading the file, also if file is emptyCopyright © 2018 CoR-Lab. All rights reserved.