| | |
| | | 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; |
| | |
| | | |
| | | 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 |
| | |
| | | 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(); |
| | |
| | | logger.fine("outfile: " + outfile.getAbsolutePath()); |
| | | HttpResponder fs = new HttpResponder(); |
| | | fs.serveFile(e, outfile); |
| | | */ |
| | | } else { |
| | | super.handle(e); // andere Inhalte zu FileHandler delegieren |
| | | } |