/** * Checks whether the file contains specific line. Partial matches do not count. */ private boolean fileIncludesLine(File file, String matches) throws IOException { for (String line: Files.readLines(file)) { String trimmed = line.trim(); if (trimmed.equals(matches)) { return true; } } return false; }