From d027b57c66dcdb183683c34101518df1572c1bf8 Mon Sep 17 00:00:00 2001 From: ulrich Date: Mon, 12 Apr 2021 16:53:30 +0000 Subject: [PATCH] Livestreams erste Fassung fertig --- src/de/uhilger/mediaz/api/StorageHandler.java | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/de/uhilger/mediaz/api/StorageHandler.java b/src/de/uhilger/mediaz/api/StorageHandler.java index e6521bc..b49b219 100644 --- a/src/de/uhilger/mediaz/api/StorageHandler.java +++ b/src/de/uhilger/mediaz/api/StorageHandler.java @@ -22,9 +22,9 @@ import de.uhilger.mediaz.App; import static de.uhilger.mediaz.App.RB_EP_LISTE; import de.uhilger.mediaz.Server; -import static de.uhilger.mediaz.Server.RB_SLASH; import de.uhilger.mediaz.store.FileStorage; import de.uhilger.mediaz.entity.Entity; +import static de.uhilger.mediaz.store.FileStorage.ST_ABLAGEORT; import java.io.IOException; import java.util.List; import java.util.logging.Level; @@ -43,7 +43,7 @@ @Override protected String put(HttpExchange e) throws IOException { String path = e.getRequestURI().toString(); - String[] elems = path.split(App.getRs(Server.RB_SLASH)); + String[] elems = path.split(Server.SLASH); String type = elems[elems.length - 2]; String elemName = elems[elems.length - 1]; // alter Name, wenn Aenderung if(!elemName.equalsIgnoreCase(App.getRs(RB_EP_LISTE))) { @@ -59,7 +59,7 @@ } else { fs.write(entity, false); } - return type + App.getRs(Server.RB_SLASH) + entity.getName(); + return type + Server.SLASH + entity.getName(); } else { return "Ungueltiges Objekt im Body."; } @@ -70,7 +70,7 @@ private boolean loeschen(HttpExchange e) { String path = e.getRequestURI().toString(); - String[] elems = path.split(App.getRs(Server.RB_SLASH)); + String[] elems = path.split(Server.SLASH); String type = elems[elems.length - 2]; String elemName = elems[elems.length - 1]; FileStorage fs = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF))); @@ -79,14 +79,17 @@ private String lesen(HttpExchange e) { String path = e.getRequestURI().toString(); - String[] elems = path.split(App.getRs(Server.RB_SLASH)); + String[] elems = path.split(Server.SLASH); FileStorage fs = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF))); - if(path.endsWith(App.getRs(RB_SLASH))) { + if(path.endsWith(Server.SLASH)) { List list = null; if(elems[elems.length - 1].equalsIgnoreCase(App.getRs(RB_EP_LISTE))) { String type = elems[elems.length - 2]; logger.fine(type); list = fs.list(type); + if(type.equalsIgnoreCase(ST_ABLAGEORT)) { + list.add("Livestreams"); + } } else { String type = elems[elems.length - 1]; logger.fine(type); -- Gitblit v1.9.3