public static int countLines(String file) {
        BufferedReader reader = null;
        int lineCount = 0;

        try {
            reader = createReader(file,"utf8");
            while (reader.readLine() != null)
                lineCount++;
            return lineCount;
        } catch (IOException e) {
            return lineCount;
        } finally {
            closeReader(reader);
        }
    }
Returns the number of lines in a file.
If the file does not exists, 0 is returned
vespajlib/src/main/java/com/yahoo/io/IOUtils.java