Refs #11288: Made resource-registry more RESTful

Task-Url: https://support.d4science.org/issues/11288

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@169104 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2018-06-12 18:04:54 +00:00
parent 4f42103a1f
commit 3a20b40169
1 changed files with 1 additions and 14 deletions

View File

@ -15,7 +15,6 @@ import javax.ws.rs.core.MediaType;
import org.gcube.informationsystem.model.entity.Context;
import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
@ -105,19 +104,7 @@ public class ContextManager {
ContextManagement contextManagement = new ContextManagement();
contextManagement.setUUID(UUID.fromString(uuid));
boolean create = false;
try {
contextManagement.read();
} catch(NotFoundException e) {
create = true;
}
contextManagement.setJSON(json);
if(create) {
return contextManagement.create();
}
return contextManagement.update();
return contextManagement.createOrUpdate();
}
/*