| | |
| | | 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); |
| | | } |
| | |
| | | } |
| | | |
| | | 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) { |
| | |
| | | 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; |