| | |
| | | import com.sun.net.httpserver.Filter; |
| | | import com.sun.net.httpserver.HttpExchange; |
| | | import com.sun.net.httpserver.HttpHandler; |
| | | import de.uhilger.httpserver.base.HttpHelper; |
| | | import de.uhilger.httpserver.base.handler.FileHandler; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | |
| | | FileHandler fileHandler = (FileHandler) handler; |
| | | String fileBase = exchange.getHttpContext().getAttributes().get(FileHandler.ATTR_FILE_BASE).toString(); |
| | | AdocActor actor = new AdocActor(); |
| | | actor.processAdocFile(new File(fileBase, fileHandler.getFileName(exchange)), Boolean.FALSE.toString()); |
| | | HttpHelper helper = new HttpHelper(); |
| | | if(query != null && query.equalsIgnoreCase("pdf=true")) { |
| | | actor.processAdocFile(new File(fileBase, helper.getFileName(exchange)), Boolean.TRUE.toString()); |
| | | } else { |
| | | actor.processAdocFile(new File(fileBase, helper.getFileName(exchange)), Boolean.FALSE.toString()); |
| | | } |
| | | } |
| | | } |
| | | chain.doFilter(exchange); |