diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java index 9c9535f..b624f9f 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java @@ -65,10 +65,14 @@ public class ContextManager { @Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8) public String read(@PathParam(ID_PATH_PARAM) String uuid) throws ContextNotFoundException, ResourceRegistryException { - logger.info("Requested to read {} with id {} ", Context.NAME, uuid); ContextManagement contextManagement = new ContextManagement(); - contextManagement.setUUID(UUID.fromString(uuid)); - return contextManagement.read(); + if(uuid.compareTo(ContextPath.ALL_PATH_PART)==0) { + return contextManagement.all(false); + }else { + logger.info("Requested to read {} with id {} ", Context.NAME, uuid); + contextManagement.setUUID(UUID.fromString(uuid)); + return contextManagement.read(); + } } /** @@ -102,13 +106,5 @@ public class ContextManager { contextManagement.setUUID(UUID.fromString(uuid)); return contextManagement.delete(); } - - @GET - @Path("{" + ContextPath.ALL_PATH_PART + "}") - @Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8) - public String all() throws ResourceRegistryException { - logger.info("Requested to get the list of all {}s", Context.NAME); - ContextManagement contextManagement = new ContextManagement(); - return contextManagement.all(false); - } + }