/** * When an object implementing interface <code>Runnable</code> is used * to create a thread, starting the thread causes the object's * <code>run</code> method to be called in that separately executing * thread. * <p> * The general contract of the method <code>run</code> is that it may * take any action whatsoever. * * @see Thread#run() */ @Override public void run() { try { LOGGER.debug(remoteURL); final HttpURLConnection connection = connect(); verifyDelete(connection); } catch (Throwable t) { LOGGER.debug("Failed to delete resource.", t); failure = t; } }
/** * Setup the HTTP Connection for use. This does not obtain a status code * or any messages from the remote endpoint, it will only establish a * connection to use. * * @return The HTTPURLConneciton instance. * @throws IOException Any connectivity issues. */ private HttpURLConnection connect() throws IOException { final HttpURLConnection connection = (HttpURLConnection) remoteURL.openConnection(); if (connection instanceof HttpsURLConnection) { final HttpsURLConnection sslConn = (HttpsURLConnection) connection; initHTTPS(sslConn); } setRequestSSOCookie(connection); connection.setRequestMethod("DELETE"); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(false); return connection; } }
HttpDelete delete = new HttpDelete(removeGroupMemberURL, true); delete.setSSLSocketFactory(getSSLSocketFactory()); delete.run(); Throwable error = delete.getThrowable(); if (error != null) if (delete.getResponseCode() == 400)
/** * Remove the Node associated with the given Path. * @param path The path of the Node to delete. */ public void deleteNode(final String path) { // length 0 is root: no // Path must be absolute final String nodePath = (path.length() > 0 && !path.startsWith("/")) ? ("/" + path) : path; try { final URL vospaceURL = lookupServiceURL(Standards.VOSPACE_NODES_20); final URL url = new URL(vospaceURL.toExternalForm() + nodePath); final HttpDelete httpDelete = new HttpDelete(url, false); httpDelete.run(); VOSClientUtil.checkFailure(httpDelete.getThrowable()); } catch (MalformedURLException e) { log.debug(String.format("Error creating URL from %s", nodePath)); throw new RuntimeException(e); } catch (NodeNotFoundException e) { log.debug("Node not found", e); throw new RuntimeException(e); } }
HttpDelete delete = new HttpDelete(deleteGroupURL, true); delete.setSSLSocketFactory(getSSLSocketFactory()); delete.run(); Throwable error = delete.getThrowable(); if (error != null) if (delete.getResponseCode() == 400)
HttpDelete delete = new HttpDelete(removeUserMemberURL, true); delete.setSSLSocketFactory(getSSLSocketFactory()); delete.run(); Throwable error = delete.getThrowable(); if (error != null) if (delete.getResponseCode() == 400)