Fixed bulkDelete/Purge API

This commit is contained in:
Luca Frosini 2021-12-07 12:30:43 +01:00
parent e28e49438f
commit 1fcea2b14b
1 changed files with 4 additions and 7 deletions

View File

@ -124,9 +124,10 @@ public class Item extends GCatClient implements org.gcube.gcat.api.interfaces.It
} }
public Void bulkDelete(Map<String,String> queryParams) throws WebServiceException{ public Void bulkDelete(Map<String,String> queryParams, boolean purge) throws WebServiceException{
try { try {
initRequest(); initRequest();
queryParams.put(GCatConstants.PURGE_QUERY_PARAMETER, String.valueOf(purge));
gxhttpStringRequest.queryParams(queryParams); gxhttpStringRequest.queryParams(queryParams);
HttpURLConnection httpURLConnection = gxhttpStringRequest.delete(); HttpURLConnection httpURLConnection = gxhttpStringRequest.delete();
parseHttpURLConnection(httpURLConnection); parseHttpURLConnection(httpURLConnection);
@ -138,17 +139,13 @@ public class Item extends GCatClient implements org.gcube.gcat.api.interfaces.It
} }
} }
public Void bulkDelete(boolean purge) throws WebServiceException{ public Void bulkDelete(boolean purge) throws WebServiceException{
return bulkDelete(null, purge);
return null;
} }
public Void bulkPurge() throws WebServiceException { public Void bulkPurge() throws WebServiceException {
return bulkDelete(null, true);
return null;
} }
protected String moderate(String name, ModerationContent moderationContent) { protected String moderate(String name, ModerationContent moderationContent) {
try { try {