private String findLine(String containing, boolean throwException) throws IOException {
        String line = reader.readLine();
        while (line != null) {
            if (line.contains(containing)) {
                return line;
            }
            line = reader.readLine();
        }

        // We've reached the end of the file
        if (throwException) {
            throw new IOException("End of file reached looking for: " + containing);
        }

        return null;
    }