| | |
| | | @Override |
| | | public void doFilter(HttpExchange exchange, Chain chain) throws IOException { |
| | | URI uri = exchange.getRequestURI(); |
| | | //String path = uri.getPath(); |
| | | try { |
| | | String path = new HttpHelper().getFileName(exchange); |
| | | if(path.endsWith(".adoc")) { |
| | | String fileName = new HttpHelper().getFileName(exchange); |
| | | if(fileName.endsWith(".adoc")) { |
| | | HttpContext ctx = exchange.getHttpContext(); |
| | | String fileBase = ctx.getAttributes().get(FileServer.ATTR_FILE_BASE).toString(); |
| | | String fileName = path.substring(ctx.getPath().length()); |
| | | String query = uri.getQuery(); |
| | | if (query instanceof String && query.contains("pdf=true")) { |
| | | processAdocFile(new File(fileBase, fileName), true); |