/** * Returns the runtime information as a JSON string. * * @return the runtime information * @throws IOException * if reading the response body fails */ private String getRuntimeInfo(String hostUrl) throws IOException { HttpGet get = new HttpGet(UrlSupport.concat(hostUrl, "/info/components.json")); HttpResponse response = null; try { response = httpClient.execute(get); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) return null; return EntityUtils.toString(response.getEntity()); } finally { httpClient.close(response); } }
response = trustedClient.execute(get); } catch (TrustedHttpClientException e) { logger.warn("Unable to fetch file from {}.", url, e);
response = client.execute(httpRequest); StatusLine status = response.getStatusLine(); if (Arrays.asList(expectedHttpStatus).contains(status.getStatusCode())) {
@Override public Either<Exception, A> run(Function<HttpResponse, A> f) { HttpResponse response = null; try { response = client.execute(req); return right(f.apply(response)); } catch (Exception e) { return left(e); } finally { if (response != null) { client.close(response); } } } };
@Override public Either<Exception, A> apply(Function<HttpResponse, A> responseHandler) { HttpResponse response = null; try { response = client.execute(httpUriRequest); return right(responseHandler.apply(response)); } catch (Exception e) { return left(e); } finally { if (response != null) { client.close(response); } } } };
try { try { response = client.execute(options); if (response != null) { switch (response.getStatusLine().getStatusCode()) {
if (!START_WORKFLOW.equals(job.getOperation())) setCurrentJob(job.toJob()); response = client.execute(post); responseStatusCode = response.getStatusLine().getStatusCode(); if (responseStatusCode == HttpStatus.SC_NO_CONTENT) {