From e771cdda4c5ccf84d6d7e686f0f22bb1ff40d2ca Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 26 Sep 2022 12:36:47 +0200 Subject: [PATCH] Restoring situation --- .../java/org/gcube/gcat/rest/docs/Docs.java | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/main/java/org/gcube/gcat/rest/docs/Docs.java b/src/main/java/org/gcube/gcat/rest/docs/Docs.java index 315ca98..8c298c5 100644 --- a/src/main/java/org/gcube/gcat/rest/docs/Docs.java +++ b/src/main/java/org/gcube/gcat/rest/docs/Docs.java @@ -21,9 +21,10 @@ import org.slf4j.LoggerFactory; public class Docs { private static Logger logger = LoggerFactory.getLogger(Docs.class); - + @GET - public InputStream toDoc1(@Context HttpServletRequest req) throws WebApplicationException { + @Path("{any: .*}") + public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException { logger.trace("Called method to redirect to docs/index.html"); String pathInfo = req.getPathInfo(); @@ -33,25 +34,6 @@ public class Docs { pathInfo += "/index.html"; } - logger.info("redirecting to {}", pathInfo); - - String realPath = req.getServletContext().getRealPath(pathInfo); - return new FileInputStream(new File(realPath)); - - } catch (Exception e) { - throw new InternalServerErrorException(e); - } - } - - - @GET - @Path("{any: .*}") - public InputStream toDoc2(@Context HttpServletRequest req) throws WebApplicationException { - logger.trace("Called method to redirect to docs/index.html"); - - String pathInfo = req.getPathInfo(); - try { - if (pathInfo.endsWith("/docs/")) { pathInfo += "index.html"; }