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/AdocFilter.java |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/de/uhilger/httpserver/adoc/AdocFilter.java b/src/de/uhilger/httpserver/adoc/AdocFilter.java
index a7d7239..4416177 100644
--- a/src/de/uhilger/httpserver/adoc/AdocFilter.java
+++ b/src/de/uhilger/httpserver/adoc/AdocFilter.java
@@ -20,6 +20,7 @@
 import com.sun.net.httpserver.Filter;
 import com.sun.net.httpserver.HttpExchange;
 import com.sun.net.httpserver.HttpHandler;
+import de.uhilger.httpserver.base.handler.FileHandler;
 import java.io.File;
 import java.io.IOException;
 import java.net.URI;
@@ -52,11 +53,11 @@
     if(requestPathStr.toLowerCase().endsWith(ADOC)) {
       logger.fine("filter: " + requestPathStr);
       HttpHandler handler = exchange.getHttpContext().getHandler();
-      if(handler instanceof AdocHandler) {
-        AdocHandler adocHandler = (AdocHandler) handler;
-        String fileBase = adocHandler.getFileBase();
+      if(handler instanceof FileHandler) {
+        FileHandler fileHandler = (FileHandler) handler;
+        String fileBase = exchange.getHttpContext().getAttributes().get(FileHandler.ATTR_FILE_BASE).toString();
         AdocActor actor = new AdocActor();
-        actor.processAdocFile(new File(fileBase, adocHandler.getFileName(exchange)), Boolean.FALSE.toString());
+        actor.processAdocFile(new File(fileBase, fileHandler.getFileName(exchange)), Boolean.FALSE.toString());
       }
     }    
     chain.doFilter(exchange);

--
Gitblit v1.9.3