Persoenliche Mediazentrale
ulrich
2021-05-06 f70acbb491c6421623cca57292a75f1820efad4d
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;