public static String readFile(File file) throws IOException {
        try {
            if (file == null) return null;
            return Files.readString(file.toPath(), utf8Charset);
        }
        catch (NoSuchFileException e) {
            throw new NoSuchFileException("Could not find file '" + file.getAbsolutePath() + "'");
        }
    }
Reads the contents of a UTF-8 text file into a String.

@param file the file to read, or null
@return the file content as a string, or null if the input file was null
vespajlib/src/main/java/com/yahoo/io/IOUtils.java