From 90c249f74bda9d718b0392bf1f70c3d44ec5cb71 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Wed, 30 Jun 2021 10:09:27 +0000
Subject: [PATCH] auf Attribute des HttpContext umgestellt

---
 src/de/uhilger/httpserver/adoc/AdocHandler.java |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/de/uhilger/httpserver/adoc/AdocHandler.java b/src/de/uhilger/httpserver/adoc/AdocHandler.java
index 69ae227..40beef7 100644
--- a/src/de/uhilger/httpserver/adoc/AdocHandler.java
+++ b/src/de/uhilger/httpserver/adoc/AdocHandler.java
@@ -18,9 +18,7 @@
 package de.uhilger.httpserver.adoc;
 
 import com.sun.net.httpserver.HttpExchange;
-import de.uhilger.httpserver.base.HttpResponder;
 import de.uhilger.httpserver.base.handler.FileHandler;
-import java.io.File;
 import java.io.IOException;
 import java.net.URI;
 import java.util.logging.Logger;
@@ -40,8 +38,12 @@
         
   private static final Logger logger = Logger.getLogger(AdocHandler.class.getName());        
   
-  public AdocHandler(String absoluteDirectoryPathAndName) {
-    super(absoluteDirectoryPathAndName);
+  /**
+   * Benoetigt das Attribut
+   * FileHandler.ATTR_FILE_BASE
+   */
+  public AdocHandler() {
+    //super(absoluteDirectoryPathAndName);
   }
 
   @Override
@@ -53,19 +55,22 @@
     String requestPathStr = uri.getPath();
     //logger.fine("filter: " + requestUriStr);    
     if(requestPathStr.toLowerCase().endsWith(AdocFilter.ADOC)) {
+      AdocActor actor = new AdocActor();
+      actor.handle(e, e.getHttpContext().getAttributes().get(FileHandler.ATTR_FILE_BASE).toString(), getFileName(e));
+      /*
       File adocfile = new File(fileBase, getFileName(e));
+      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);
+      */
     } else {
       super.handle(e); // andere Inhalte zu FileHandler delegieren
     }
   }
   
-  public String getFileBase() {
-    return this.fileBase;
-  }
   
   
 }

--
Gitblit v1.9.3