Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DocumentationController {
- @GET
- @Path("/doc")
- public static Object get(Response response,Request request) throws Exception{
- String path = "/apps/static/doc/";
- String fileName = "api.html";
- File file = new File(path + fileName);
- String htmlContent = null;
- try {
- htmlContent = Files.asCharSource(file, Charsets.UTF_8).read();
- } catch (IOException e) {
- throw new Exception(e.getMessage());
- }
- response.status(HttpServletResponse.SC_OK);
- request.header("Content-Type", MediaType.HTML_UTF_8.toString());
- return htmlContent;
- }
Add Comment
Please, Sign In to add comment