public List<String> readFile(String file){
try {
Path path = Paths.get(file);
return Files.readAllLines(path,
StandardCharsets.UTF_8);
} catch (IOException e) {
// io exception reading from file...
}
return null;
}
public void writeToFile(String file, List<String> lines){
try {
Path path = Paths.get(file);
Files.write(path, lines);
} catch (IOException e) {
// io exception writing to file...
}
}
Comments