@Override protected void removeAll(String clustername) { if(clustername == null) return; try { Map headers=new TreeMap(); headers.put("Content-Type", Collections.singletonList("text/plain")); clustername=sanitize(clustername); ListBucketResponse rsp=conn.listBucket(location, clustername, null, null, null); if(rsp.entries != null) { for(Iterator<ListEntry> it=rsp.entries.iterator(); it.hasNext();) { ListEntry key=it.next(); try { if (usingPreSignedUrls()) conn.delete(pre_signed_delete_url).connection.getResponseMessage(); else conn.delete(location, key.key, headers).connection.getResponseMessage(); log.trace("removing %s/%s", location, key.key); } catch(Throwable t) { log.error("failed deleting object %s/%s: %s", location, key.key, t); } } } } catch(IOException ex) { log.error(Util.getMessage("FailedDeletingAllObjects"), ex); } }
protected void remove(String clustername, Address addr) { if(clustername == null || addr == null) return; String filename=addressToFilename(addr);// addr instanceof org.jgroups.util.UUID? ((org.jgroups.util.UUID)addr).toStringLong() : addr.toString(); String key=sanitize(clustername) + "/" + sanitize(filename); try { Map headers=new TreeMap(); headers.put("Content-Type", Collections.singletonList("text/plain")); if (usingPreSignedUrls()) { conn.delete(pre_signed_delete_url).connection.getResponseMessage(); } else { conn.delete(location, key, headers).connection.getResponseMessage(); } if(log.isTraceEnabled()) log.trace("removing " + location + "/" + key); } catch(Exception e) { log.error(Util.getMessage("FailureRemovingData"), e); } }
@Override protected void removeAll(String clustername) { if(clustername == null) return; try { Map headers=new TreeMap(); headers.put("Content-Type", Collections.singletonList("text/plain")); clustername=sanitize(clustername); ListBucketResponse rsp=conn.listBucket(location, clustername, null, null, null); if(rsp.entries != null) { for(Iterator<ListEntry> it=rsp.entries.iterator(); it.hasNext();) { ListEntry key=it.next(); try { if (usingPreSignedUrls()) conn.delete(pre_signed_delete_url).connection.getResponseMessage(); else conn.delete(location, key.key, headers).connection.getResponseMessage(); log.trace("removing %s/%s", location, key.key); } catch(Throwable t) { log.error("failed deleting object %s/%s: %s", location, key.key, t); } } } } catch(IOException ex) { log.error(Util.getMessage("FailedDeletingAllObjects"), ex); } }
protected void remove(String clustername, Address addr) { if(clustername == null || addr == null) return; String filename=addressToFilename(addr);// addr instanceof org.jgroups.util.UUID? ((org.jgroups.util.UUID)addr).toStringLong() : addr.toString(); String key=sanitize(clustername) + "/" + sanitize(filename); try { Map headers=new TreeMap(); headers.put("Content-Type", Collections.singletonList("text/plain")); if (usingPreSignedUrls()) { conn.delete(pre_signed_delete_url).connection.getResponseMessage(); } else { conn.delete(location, key, headers).connection.getResponseMessage(); } if(log.isTraceEnabled()) log.trace("removing " + location + "/" + key); } catch(Exception e) { log.error(Util.getMessage("FailureRemovingData"), e); } }