code: public static UNode parse(File file, ContentType contentType) throws Exception {
          try (Reader reader = new BufferedReader(new FileReader(file))) {
              UNode result = null;
              if (contentType.isJSON()) {
                  result = parseJSON(reader);
              } else if (contentType.isXML()) {
                  result = parseXML(reader);
              } else {
                  Utils.require(false, "Unsupported content-type: " + contentType);
              }
              return result;
          }
      }
docs: Parse the text from the given file, formatted with the given content-type, into a
  UNode tree and return the root node. The file is read with a BufferedReader over
  a FileReader using the default encoding for the current system. Any I/O exception
  or parsing error is passed to the caller.
  
  @param file          File to read source from.
  @param contentType   {@link ContentType} of text. Only JSON and XML are supported.
  @return              Root node of parsed node tree.
  @throws Exception    If the file is not found, an I/O error occurs, or a parsing
  error occurs.