class Metadata {

  public static Vulnerability getVulnerabilityMetadata(String rootDir)
      throws JsonSyntaxException, IOException {
    String filePath = rootDir + File.separator + META_PROPERTIES_FILE;
    if (!FileUtil.isAccessibleFile(filePath)) {
      throw new IllegalArgumentException(
          "The root folder "
              + rootDir
              + "  or the meta file in root directory is missing "
              + filePath);
    }

    Gson gson = new Gson();
    Vulnerability metadata = null;
    metadata = gson.fromJson(FileUtil.readFile(filePath), Vulnerability.class);

    if (StringUtils.isBlank(metadata.getVulnId())) {
      throw new IllegalArgumentException(
          "The vulnerability_id is missing missing in the " + filePath + " file");
    }

    return metadata;
  }

}