From a43e1a055018aab9590c88c45d8495f99bfb6254 Mon Sep 17 00:00:00 2001 From: ulrich Date: Mon, 05 Apr 2021 18:39:49 +0000 Subject: [PATCH] Ablageort-Liste --- src/de/uhilger/mediaz/api/AblageTestHandler.java | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/de/uhilger/mediaz/api/AblageTestHandler.java b/src/de/uhilger/mediaz/api/AblageTestHandler.java index 05e18e7..b22a6f5 100644 --- a/src/de/uhilger/mediaz/api/AblageTestHandler.java +++ b/src/de/uhilger/mediaz/api/AblageTestHandler.java @@ -8,7 +8,7 @@ import com.google.gson.Gson; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; -import de.uhilger.mediaz.entity.Ablage; +import de.uhilger.mediaz.entity.Ablageort; import java.io.File; import java.io.IOException; import java.io.OutputStream; @@ -21,19 +21,20 @@ @Override public void handle(HttpExchange e) throws IOException { - Ablage ablage = new Ablage(); - ablage.setName("Katalog"); - ablage.setOrt("/home/ulrich/Videos"); + Ablageort ablageort = new Ablageort(); + ablageort.setName("Katalog"); + ablageort.setOrt("/home/ulrich/Videos"); + ablageort.setUrl("/media/test"); Gson gson = new Gson(); - File mediaOrdner = new File(ablage.getOrt()); + File mediaOrdner = new File(ablageort.getOrt()); File[] files = mediaOrdner.listFiles(); String json = gson.toJson(files); StringBuilder sb = new StringBuilder(); sb.append(json); - json = gson.toJson(ablage); + json = gson.toJson(ablageort); sb.append(json); byte[] b = sb.toString().getBytes(); -- Gitblit v1.9.3