From f5adf51f59628c210d6bc8838df99d9b64002ee5 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Fri, 25 Jun 2021 09:55:05 +0000
Subject: [PATCH] Logik in den Actor ausgelagert

---
 src/de/uhilger/httpserver/adoc/AdocActor.java |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/de/uhilger/httpserver/adoc/AdocActor.java b/src/de/uhilger/httpserver/adoc/AdocActor.java
index eda9c5c..94944f9 100644
--- a/src/de/uhilger/httpserver/adoc/AdocActor.java
+++ b/src/de/uhilger/httpserver/adoc/AdocActor.java
@@ -17,7 +17,10 @@
  */
 package de.uhilger.httpserver.adoc;
 
+import com.sun.net.httpserver.HttpExchange;
+import de.uhilger.httpserver.base.HttpResponder;
 import java.io.File;
+import java.io.IOException;
 import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -46,6 +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 {
+    File adocfile = new File(fileBase, fileName);
+    logger.fine("adocfile: " + adocfile.getAbsolutePath());
+    AdocActor actor = new AdocActor();
+    File outfile = actor.getTargetFile(adocfile, AdocActor.HTML);
+    logger.fine("outfile: " + outfile.getAbsolutePath());
+    HttpResponder fs = new HttpResponder();
+    fs.serveFile(e, outfile);
+  }
+  
   public File getTargetFile(File adocfile, String ext) {
     String nameext = adocfile.getName();
     String fname = nameext.substring(0, nameext.lastIndexOf(DOT));

--
Gitblit v1.9.3