| | |
| | | public static final String HTML = "html"; |
| | | public static final String PDF = "pdf"; |
| | | |
| | | public void handle(HttpExchange e, String fileBase, String fileName) throws IOException { |
| | | public void handle(HttpExchange e, String fileBase, String fileName, boolean pdf) throws IOException { |
| | | File adocfile = new File(fileBase, fileName); |
| | | logger.fine("adocfile: " + adocfile.getAbsolutePath()); |
| | | AdocActor actor = new AdocActor(); |
| | | File outfile = actor.getTargetFile(adocfile, AdocActor.HTML); |
| | | File outfile; |
| | | if(pdf) { |
| | | outfile = actor.getTargetFile(adocfile, AdocActor.PDF); |
| | | } else { |
| | | outfile = actor.getTargetFile(adocfile, AdocActor.HTML); |
| | | } |
| | | logger.fine("outfile: " + outfile.getAbsolutePath()); |
| | | HttpResponder fs = new HttpResponder(); |
| | | fs.serveFile(e, outfile); |