From 47331ea20947ce9abd093b697b9cae947967108b Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 10 May 2024 11:08:13 +0200 Subject: [PATCH] Added hidden path for reserved operations --- .../geoportal/service/rest/ProfiledDocuments.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/ProfiledDocuments.java b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/ProfiledDocuments.java index 8c2726a..26088c2 100644 --- a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/ProfiledDocuments.java +++ b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/ProfiledDocuments.java @@ -61,6 +61,7 @@ import lombok.extern.slf4j.Slf4j; @RequestHeader(name = "Content-Type", description = "application/json") }) public class ProfiledDocuments { + public static final String HIDDEN_PATH = "hidden"; private ProfiledMongoManager manager; private EventManager eventManager = EventManager.getInstance(); // as singleton @@ -229,6 +230,8 @@ public class ProfiledDocuments { * @param id the id * @param force the force * @return the boolean + * + * Added by Francesco M. */ @DELETE @Produces(MediaType.APPLICATION_JSON) @@ -246,10 +249,11 @@ public class ProfiledDocuments { * @return the boolean * * @Ignore means excluded by API doc + * Updated by Francesco M. */ @DELETE @Produces(MediaType.APPLICATION_JSON) - @Path("{" + InterfaceConstants.Parameters.PROJECT_ID + "}") + @Path("{" + InterfaceConstants.Parameters.PROJECT_ID + "}"+"/"+HIDDEN_PATH) @Ignore public Boolean delete(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id, @DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force, @QueryParam(InterfaceConstants.Parameters.IGNORE_ERRORS) Boolean ignoreErrors) { @@ -327,6 +331,8 @@ public class ProfiledDocuments { * @param force the force * @param path the path must be passed as text in the body * @return the project + * + * Added by Francesco M */ @RequestHeaders({ @RequestHeader(name = "Authorization", description = "VRE Bearer token, see https://dev.d4science.org/how-to-access-resources"), @@ -351,6 +357,7 @@ public class ProfiledDocuments { * @return the project * * @Ignore means that is excluded by API doc + * Updated by Francesco M. */ @RequestHeaders({ @RequestHeader(name = "Authorization", description = "VRE Bearer token, see https://dev.d4science.org/how-to-access-resources"), @@ -358,7 +365,7 @@ public class ProfiledDocuments { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - @Path("/" + InterfaceConstants.Methods.DELETE_FILES_PATH + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}") + @Path("/" + InterfaceConstants.Methods.DELETE_FILES_PATH +"/"+HIDDEN_PATH+"/{" + InterfaceConstants.Parameters.PROJECT_ID + "}") @Ignore public Project deleteFileSet(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id, @DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force,