From 78d7078d97625e4a8d2d6863318c192f910f2ec9 Mon Sep 17 00:00:00 2001 From: ulrich Date: Sun, 11 Apr 2021 11:09:36 +0000 Subject: [PATCH] UI-Verbesserungen in Arbeit --- src/de/uhilger/mediaz/api/FileHandler.java | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/de/uhilger/mediaz/api/FileHandler.java b/src/de/uhilger/mediaz/api/FileHandler.java index ab20120..5b8f846 100644 --- a/src/de/uhilger/mediaz/api/FileHandler.java +++ b/src/de/uhilger/mediaz/api/FileHandler.java @@ -22,7 +22,6 @@ import com.sun.net.httpserver.HttpHandler; import de.uhilger.mediaz.App; import de.uhilger.mediaz.Server; -import static de.uhilger.mediaz.Server.RB_SLASH; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -48,7 +47,7 @@ * @author Ulrich Hilger * @version 0.1, 25. März 2021 */ -public class FileHandler implements HttpHandler { +public class FileHandler extends JsonHelper implements HttpHandler { /* Der Logger fuer diesen FileHandler */ private static final Logger logger = Logger.getLogger(FileHandler.class.getName()); @@ -83,7 +82,7 @@ public static final String RB_WELCOME_FILE = "welcomeFile"; /* Ablageort fuer Webinhalte */ - private final String fileBase; + protected final String fileBase; /** * Ein neues Objekt der Klasse FileHandler erzeugen @@ -115,7 +114,7 @@ if (headers.containsKey(RANGE_HEADER)) { serveFileParts(e, new File(fileBase, fName)); } else { - if (fName.length() < 1 || fName.endsWith(App.getRs(RB_SLASH))) { + if (fName.length() < 1 || fName.endsWith(Server.SLASH)) { fName += App.getRs(RB_WELCOME_FILE); } serveFile(e, new File(fileBase, fName)); @@ -133,7 +132,7 @@ protected String getFileName(HttpExchange e) { String ctxPath = e.getHttpContext().getPath(); String uriPath = e.getRequestURI().getPath(); - logger.info(uriPath); + logger.fine(uriPath); return uriPath.substring(ctxPath.length()); } @@ -317,7 +316,7 @@ sb.append(range.getStart()); sb.append(App.getRs(RB_DASH)); sb.append(range.getEnd()); - sb.append(App.getRs(RB_SLASH)); + sb.append(Server.SLASH); sb.append(file.length()); return sb.toString(); } -- Gitblit v1.9.3