From 8287036997695e731d68d380834cd63919a7a80e Mon Sep 17 00:00:00 2001
From: ulrich
Date: Mon, 10 Jan 2022 16:11:28 +0000
Subject: [PATCH] Nicht benoetigte Klassen entfernt

---
 src/de/uhilger/tango/api/ListHandler.java |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/de/uhilger/tango/api/ListHandler.java b/src/de/uhilger/tango/api/ListHandler.java
index 719f911..8154211 100644
--- a/src/de/uhilger/tango/api/ListHandler.java
+++ b/src/de/uhilger/tango/api/ListHandler.java
@@ -45,14 +45,19 @@
   private static final Logger logger = Logger.getLogger(ListHandler.class.getName());
   
   public static final String ALLE_TITEL = "alle";
-
+  
+  private String conf;
+  
+  public ListHandler(String conf) {
+    this.conf = conf;
+  }
 
   @Override
   protected String get(HttpExchange e) {
     String path = e.getRequestURI().toString();
     String[] elems = path.split(Server.SLASH);
     String plname = elems[elems.length - 1];
-    FileStorage fs = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF)));
+    FileStorage fs = new FileStorage(conf);
     String json = fs.readJson(FileStorage.ST_ABSPIELLISTE, plname);
     return embedInCustomType(json, FileStorage.ST_ABSPIELLISTE);
   }
@@ -75,7 +80,7 @@
   }
   
   private String addTitel(HttpExchange e, String plname) throws IOException {
-    FileStorage fs = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF)));
+    FileStorage fs = new FileStorage(conf);
     Entity entity = fs.read(FileStorage.ST_ABSPIELLISTE, plname);
     String response = "Titel konnte nicht hinzugefuegt werden.";
     if(entity instanceof Abspielliste) {
@@ -104,7 +109,7 @@
     String path = e.getRequestURI().toString();
     String[] elems = path.split(Server.SLASH);
     String listName = elems[elems.length - 2];
-    FileStorage fs = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF)));
+    FileStorage fs = new FileStorage(conf);
     Entity entity = fs.read(Abspielliste.class.getSimpleName(), listName);
     if(entity instanceof Abspielliste) {
       Abspielliste liste = (Abspielliste) entity;

--
Gitblit v1.9.3