for (File file : files) {
if (file.isFile()) {
String filename = file.getName();
try {
List<String> lines = Files.readAllLines(file.toPath(), StandardCharsets.UTF_8);
list.add(new LogFile(filename, lines));
} catch (IOException e) {
throw new CommunicationException("Log file " + filename + " could not be read", e);
}
}
}