Fixing docs
This commit is contained in:
parent
c0e731b01a
commit
60b43cc1b4
|
@ -23,18 +23,17 @@ public class ApiDocs {
|
||||||
private static Logger logger = LoggerFactory.getLogger(ApiDocs.class);
|
private static Logger logger = LoggerFactory.getLogger(ApiDocs.class);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
// @Path("{any: .*}")
|
|
||||||
public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException {
|
public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException {
|
||||||
logger.trace("Called method to redirect to api-docs/index.html");
|
logger.trace("Called method to redirect to api-docs/index.html");
|
||||||
|
|
||||||
String pathInfo = req.getPathInfo();
|
String pathInfo = req.getPathInfo();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (pathInfo.endsWith("api-docs")) {
|
if (pathInfo.endsWith("/api-docs")) {
|
||||||
pathInfo += "/index.html";
|
pathInfo += "/index.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathInfo.endsWith("api-docs/")) {
|
if (pathInfo.endsWith("/api-docs/")) {
|
||||||
pathInfo += "index.html";
|
pathInfo += "index.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,21 +22,18 @@ public class Docs {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(Docs.class);
|
private static Logger logger = LoggerFactory.getLogger(Docs.class);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
// @Path("{any: .*}")
|
|
||||||
public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException {
|
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();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (pathInfo.endsWith("docs")) {
|
if (pathInfo.endsWith("/docs")) {
|
||||||
pathInfo += "/index.html";
|
pathInfo += "/index.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathInfo.endsWith("docs/")) {
|
if (pathInfo.endsWith("/docs/")) {
|
||||||
pathInfo += "index.html";
|
pathInfo += "index.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue