From 8b9c74e666021152c73db133f772dc68f5efb36c Mon Sep 17 00:00:00 2001 From: ulrich Date: Tue, 26 Oct 2021 11:22:38 +0000 Subject: [PATCH] PDF ergaenzt (noch experimentell) --- src/de/uhilger/httpserver/adoc/AdocActor.java | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/de/uhilger/httpserver/adoc/AdocActor.java b/src/de/uhilger/httpserver/adoc/AdocActor.java index 08bb487..d12270a 100644 --- a/src/de/uhilger/httpserver/adoc/AdocActor.java +++ b/src/de/uhilger/httpserver/adoc/AdocActor.java @@ -49,11 +49,16 @@ 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); -- Gitblit v1.9.3