private void releaseReadingList(HttpGet getMethod) { if (!getMethod.isAborted()) /* * try { getreadingliststream.close(); } catch (IOException e) { // * TODO Auto-generated catch block e.printStackTrace(); } */ getMethod.abort(); }
protected String executeGetRequest(String request) { HttpGet httpGet = null; try { prepareRequest(); request = removeDiscReference(request); request = request.replace(" ", "%20"); if (DEBUG) Log.d(getName(), "Http request : " + request); httpGet = new HttpGet(request); return executeRequest(httpGet); } finally { if (request != null && !httpGet.isAborted()) { httpGet.abort(); } } }
public void stopPolling() throws Exception { if (!done) { // done polling done = true; // make sure an HTTP GET is not in progress if (httpGet != null && !httpGet.isAborted()) { httpGet.abort(); } // cancel polling thread if (pollFuture.cancel(true)) { LOG.info("Stopped event polling for " + cachedBoxClient); } else { LOG.warn("Unable to stop event polling for " + cachedBoxClient); } httpClient = null; pollFuture = null; } }