Asciidoctor mit Neon transformieren
ulrich
2021-06-30 90c249f74bda9d718b0392bf1f70c3d44ec5cb71
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,14 +53,13 @@
    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);
  }