public String getFileContent()

in ddm-rrm-gerrit-integration/src/main/java/com/epam/digital/data/platform/management/gerritintegration/service/GerritServiceImpl.java [213:236]


  public String getFileContent(String changeId, String filePath) {
    try {
      if (changeId != null) {
        String currentRevision = gerritApi.changes().id(changeId).get().currentRevision;
        String request = String.format("/changes/%s/revisions/%s/files/%s/content", changeId,
            currentRevision, filePath.replace("/", "%2F"));
        JsonElement response = gerritApi.restClient().getRequest(request);
        return response.getAsString();
      }
    } catch (HttpStatusException ex) {
      if (ex.getStatusCode() == HttpStatus.NOT_FOUND.value()) {
        throw new GerritChangeNotFoundException("Could not found candidate with id " + changeId,
            ex);
      } else {
        throw new GerritCommunicationException(
            "Something went wrong wile getting file content from candidate with id " + changeId,
            ex);
      }
    } catch (RestApiException ex) {
      throw new GerritCommunicationException(
          "Something went wrong wile getting file content from candidate with id " + changeId, ex);
    }
    return null;
  }