@Override public void close() throws IOException { if (!isNull()) { try { super.close(); } catch (IOException e) { // silently ignore } } method.releaseConnection(); } }
return false; } finally { firstPutReq.releaseConnection();
logger.error("Fatal transport error: {}", ioe.toString()); } finally { method.releaseConnection();
@Override public void close() { httpMethod.releaseConnection(); //Protocol.unregisterProtocol("https"); } }
@Override public void dispose() { if (responseBodyAsStream != null) { try { responseBodyAsStream.close(); } catch (IOException e) { // ignore } } if (methodResponse != null) { methodResponse.releaseConnection(); methodResponse = null; } }
@Override public void dispose() { if (responseBodyAsStream != null) { try { responseBodyAsStream.close(); } catch (IOException e) { // ignore } } if (methodResponse != null) { methodResponse.releaseConnection(); methodResponse = null; } }
@Override protected void closeConnection(HttpRequest request, oauth.signpost.http.HttpResponse response) throws Exception { if (response != null) { HttpMethod method = (HttpMethod) response.unwrap(); if (method != null) { method.releaseConnection(); } } } }
public void wipeCache(String type, String action, String name) throws IOException { String url = baseUrl + "/cache/" + type + "/" + name + "/" + action; HttpMethod request = new PutMethod(url); try { int code = client.executeMethod(request); String msg = Bytes.toString(request.getResponseBody()); if (code != 200) throw new IOException("Invalid response " + code + " with cache wipe url " + url + "\n" + msg); } catch (HttpException ex) { throw new IOException(ex); } finally { request.releaseConnection(); } }
public String getKylinProperties() throws IOException { String url = baseUrl + "/admin/config"; HttpMethod request = new GetMethod(url); try { int code = client.executeMethod(request); String msg = Bytes.toString(request.getResponseBody()); JSONObject obj = new JSONObject(msg); msg = obj.getString("config"); if (code != 200) throw new IOException("Invalid response " + code + " with cache wipe url " + url + "\n" + msg); return msg; } catch (JSONException e) { throw new IOException("Error when parsing json response from REST"); } finally { request.releaseConnection(); } }
/** * Release the resources associated with this response */ public void release() { method.releaseConnection(); }
private int execute(HttpMethod method) throws IOException { try { // we don't even read the response body // the statusCode is enough information return client.executeMethod(method); } catch (IOException e) { // probably either configuration error or IDEA is not running throw new IOException("Failed to communicate with JumpToCode", e); } finally { method.releaseConnection(); } }
@Override public void close() throws IOException { super.close(); getHttpMethod().releaseConnection(); } };
public void close() throws IOException { super.close(); if (method != null) { method.releaseConnection(); } } }
private Map<String, String> executeAndGetHeaders(HttpMethod method) throws IOException { try { client.executeMethod(method); return Arrays.stream(method.getResponseHeaders()) .collect(Collectors.toMap(Header::getName, Header::getValue)); } catch (IOException e) { // probably either configuration error or IDEA is not running throw new IOException("Failed to communicate with JumpToCode", e); } finally { method.releaseConnection(); } }
protected Response request(HttpMethod method) throws IOException { final int statusCode; final String body; try { statusCode = client.executeMethod(method); body = new String(method.getResponseBody(), "utf-8"); logger.debug("Remote Control replied with '" + statusCode + " / '" + body + "'"); return new Response(statusCode, body); } finally { method.releaseConnection(); } }
protected Response request(HttpMethod method) throws IOException { final int statusCode; final String body; try { statusCode = client.executeMethod(method); body = new String(method.getResponseBody(), "utf-8"); logger.info("Remote Control replied with '" + statusCode + " / '" + body + "'"); return new Response(statusCode, body); } finally { method.releaseConnection(); } }
@Override public void close() throws IOException { if (!isNull()) { try { super.close(); } catch (IOException e) { // silently ignore } } method.releaseConnection(); } }
@Override public void close() throws IOException { if (!isNull()) { try { super.close(); } catch (IOException e) { // silently ignore } } method.releaseConnection(); } }
@Override public void close() throws IOException { if (!isNull()) { try { super.close(); } catch (IOException e) { // silently ignore } } method.releaseConnection(); } }