class Metadata {

  public static Commit getCommitMetadata(String commitDir) throws JsonSyntaxException, IOException {
    String filePath = commitDir + File.separator + META_PROPERTIES_FILE;
    if (!FileUtil.isAccessibleFile(filePath)) {
      log.error(
          "The commit folder {} or the meta file is missing {} in commit folder",
          commitDir,
          filePath);
      return null;
    }

    Gson gson = new Gson();
    Commit metadata = null;
    metadata = gson.fromJson(FileUtil.readFile(filePath), Commit.class);
    metadata.setDirectory(commitDir);
    return metadata;
  }

}