Restoring situation
This commit is contained in:
parent
50fea5ba56
commit
e771cdda4c
|
@ -23,7 +23,8 @@ public class Docs {
|
||||||
private static Logger logger = LoggerFactory.getLogger(Docs.class);
|
private static Logger logger = LoggerFactory.getLogger(Docs.class);
|
||||||
|
|
||||||
@GET
|
@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");
|
logger.trace("Called method to redirect to docs/index.html");
|
||||||
|
|
||||||
String pathInfo = req.getPathInfo();
|
String pathInfo = req.getPathInfo();
|
||||||
|
@ -33,25 +34,6 @@ public class Docs {
|
||||||
pathInfo += "/index.html";
|
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/")) {
|
if (pathInfo.endsWith("/docs/")) {
|
||||||
pathInfo += "index.html";
|
pathInfo += "index.html";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue