From e28e49438fb0a222af0f6e683e790758254f58f0 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 3 Dec 2021 17:40:41 +0100 Subject: [PATCH] Fixed APIs --- src/main/java/org/gcube/gcat/client/Item.java | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/gcat/client/Item.java b/src/main/java/org/gcube/gcat/client/Item.java index e5342ca..9031090 100644 --- a/src/main/java/org/gcube/gcat/client/Item.java +++ b/src/main/java/org/gcube/gcat/client/Item.java @@ -28,7 +28,6 @@ public class Item extends GCatClient implements org.gcube.gcat.api.interfaces.It super(enforcedServiceURL, ITEMS); } - @Override public int count() throws WebServiceException { Map queryParams = new HashMap<>(); queryParams.put(GCatConstants.COUNT_PARAMETER, String.valueOf(true)); @@ -58,7 +57,6 @@ public class Item extends GCatClient implements org.gcube.gcat.api.interfaces.It return this.list(queryParams); } - public String list(Map queryParams) throws WebApplicationException { return super.list(queryParams); } @@ -124,6 +122,33 @@ public class Item extends GCatClient implements org.gcube.gcat.api.interfaces.It super.delete(true, name); return null; } + + + public Void bulkDelete(Map queryParams) throws WebServiceException{ + try { + initRequest(); + gxhttpStringRequest.queryParams(queryParams); + HttpURLConnection httpURLConnection = gxhttpStringRequest.delete(); + parseHttpURLConnection(httpURLConnection); + return null; + }catch (WebApplicationException e) { + throw e; + }catch (Exception e) { + throw new WebApplicationException(e); + } + } + + + public Void bulkDelete(boolean purge) throws WebServiceException{ + + return null; + } + + public Void bulkPurge() throws WebServiceException { + + return null; + } + protected String moderate(String name, ModerationContent moderationContent) { try {