code: @SuppressWarnings("unchecked")
      public static Map<String, Object> readYaml(File targetFile) throws IOException
      {
          Map<String, Object> configObject = null;
          Yaml yaml = new Yaml();
  
          InputStream inputStream = null;
          InputStreamReader steamReader = null;
  
          try
          {
              inputStream = new FileInputStream(targetFile);
              steamReader = new InputStreamReader(inputStream, "UTF-8");
              configObject = (Map<String, Object>) yaml.load(steamReader);
          }
          catch (ScannerException ex)
          {
              // ScannerException/IOException are occured.
              // throw IOException because handling is same.
              throw new IOException(ex);
          }
          finally
          {
              IOUtils.closeQuietly(inputStream);
          }
  
          return configObject;
      }
docs: Read yaml config object from the yaml file at specified file.
  
  @param targetFile target file
  @return config read from yaml
  @throws IOException Fail read yaml file or convert to config object.