| | |
| | | import com.sun.net.httpserver.Filter; |
| | | import com.sun.net.httpserver.HttpExchange; |
| | | import com.sun.net.httpserver.HttpHandler; |
| | | import de.uhilger.httpserver.base.handler.FileHandler; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.net.URI; |
| | |
| | | if(requestPathStr.toLowerCase().endsWith(ADOC)) { |
| | | logger.fine("filter: " + requestPathStr); |
| | | HttpHandler handler = exchange.getHttpContext().getHandler(); |
| | | if(handler instanceof AdocHandler) { |
| | | AdocHandler adocHandler = (AdocHandler) handler; |
| | | String fileBase = adocHandler.getFileBase(); |
| | | if(handler instanceof FileHandler) { |
| | | FileHandler fileHandler = (FileHandler) handler; |
| | | String fileBase = fileHandler.getFileBase(); |
| | | AdocActor actor = new AdocActor(); |
| | | actor.processAdocFile(new File(fileBase, adocHandler.getFileName(exchange)), Boolean.FALSE.toString()); |
| | | actor.processAdocFile(new File(fileBase, fileHandler.getFileName(exchange)), Boolean.FALSE.toString()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | chain.doFilter(exchange); |
| | | } |
| | | |