Пример #1
0
 @NotNull
 @Override
 public String listFiles() throws URISyntaxException, IOException {
   URI uri = httpConnector.buildUri(createUrl(stashPatchset, CHANGES_URL_FORMAT));
   CloseableHttpResponse httpResponse = httpConnector.logAndExecute(new HttpGet(uri));
   return httpConnector.consumeAndLogEntity(httpResponse);
 }
Пример #2
0
 @NotNull
 @Override
 public String sendReview(String reviewInputAsJson) throws URISyntaxException, IOException {
   URI uri = httpConnector.buildUri(createUrl(stashPatchset, COMMENTS_URL_FORMAT));
   HttpPost httpPost = new HttpPost(uri);
   httpPost.setEntity(new StringEntity(reviewInputAsJson, ContentType.APPLICATION_JSON));
   CloseableHttpResponse httpResponse = httpConnector.logAndExecute(httpPost);
   return httpConnector.consumeAndLogEntity(httpResponse);
 }
Пример #3
0
 public String getDiffByLine(String filename) throws URISyntaxException, IOException {
   URI uri =
       httpConnector.buildUri(
           createUrl(stashPatchset, DIFF_URL_FORMAT) + "/" + filename,
           new BasicNameValuePair("contextLines", "-1"),
           new BasicNameValuePair("srcPath", filename),
           new BasicNameValuePair("withComments", "true"));
   HttpGet httpGet = new HttpGet(uri);
   CloseableHttpResponse httpResponse = httpConnector.logAndExecute(httpGet);
   return httpConnector.consumeAndLogEntity(httpResponse);
 }