Fixed api-docs and docs path
This commit is contained in:
parent
0e1237c1fb
commit
86245a0899
|
@ -3,7 +3,6 @@ package org.gcube.gcat;
|
|||
import javax.ws.rs.ApplicationPath;
|
||||
|
||||
import org.gcube.gcat.rest.Group;
|
||||
import org.gcube.gcat.rest.docs.Docs;
|
||||
import org.glassfish.jersey.server.ResourceConfig;
|
||||
|
||||
/**
|
||||
|
@ -14,7 +13,6 @@ public class ResourceInitializer extends ResourceConfig {
|
|||
|
||||
public ResourceInitializer() {
|
||||
packages(Group.class.getPackage().toString());
|
||||
// packages(Docs.class.getPackage().toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
package org.gcube.gcat.rest.docs;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.InternalServerErrorException;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI-CNR)
|
||||
*/
|
||||
//@Path("api-docs")
|
||||
public class ApiDocs {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(ApiDocs.class);
|
||||
|
||||
// @GET
|
||||
// @Path("{any:.*}")
|
||||
// public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException {
|
||||
// logger.trace("Called method to redirect to api-docs/index.html");
|
||||
//
|
||||
// String pathInfo = req.getPathInfo();
|
||||
// try {
|
||||
//
|
||||
// if (pathInfo.endsWith("/api-docs")) {
|
||||
// pathInfo += "/index.html";
|
||||
// }
|
||||
//
|
||||
// if (pathInfo.endsWith("/api-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);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
package org.gcube.gcat.rest.docs;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.InternalServerErrorException;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.WebApplicationException;
|
||||
import javax.ws.rs.core.Context;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI-CNR)
|
||||
*/
|
||||
// @Path("docs")
|
||||
public class Docs {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(Docs.class);
|
||||
|
||||
// @GET
|
||||
// @Path("{any:.*}")
|
||||
// public InputStream toDoc(@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";
|
||||
// }
|
||||
//
|
||||
// if (pathInfo.endsWith("/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);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue