Maybe this method here might help you:

Files.readAllLines(path)
It will read a file and return a List<String> of all lines.

Maybe it will make your life a little easier.