code: public static String readFileToString(File file, String encoding) throws IOException {
      InputStream in = null;
      try {
        in = openInputStream(file);
        return IOUtils.toString(in, encoding);
      } finally {
        IOUtils.closeQuietly(in);
      }
    }
docs: Reads the contents of a file into a String.
  The file is always closed.
  
  @param file  the file to read, must not be <code>null</code>
  @param encoding  the encoding to use, <code>null</code> means platform default
  @return the file contents, never <code>null</code>
  @throws IOException in case of an I/O error
  @throws java.io.UnsupportedEncodingException if the encoding is not supported by the VM