From 90f5d4ea4ddcded966c09809f3e65a54941a81c8 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Tue, 06 Apr 2021 09:00:43 +0000
Subject: [PATCH] Ablageort bearbeiten und loeschen in Arbeit

---
 src/de/uhilger/mediaz/api/StoreTestHandler.java |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/de/uhilger/mediaz/api/StoreTestHandler.java b/src/de/uhilger/mediaz/api/StoreTestHandler.java
index 9735b8e..156e06c 100644
--- a/src/de/uhilger/mediaz/api/StoreTestHandler.java
+++ b/src/de/uhilger/mediaz/api/StoreTestHandler.java
@@ -7,14 +7,15 @@
 
 import com.sun.net.httpserver.HttpExchange;
 import com.sun.net.httpserver.HttpHandler;
-import de.uhilger.mediaz.conf.Store;
-import de.uhilger.mediaz.entity.Ablage;
-import de.uhilger.mediaz.entity.ConfigurationElement;
+import de.uhilger.mediaz.App;
+import de.uhilger.mediaz.store.FileStorage;
+import de.uhilger.mediaz.entity.Ablageort;
 import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import de.uhilger.mediaz.entity.Entity;
 
 /**
  *
@@ -27,13 +28,14 @@
 
   @Override
   public void handle(HttpExchange e) throws IOException {
-    Ablage ablage = new Ablage();
-    ablage.setName("Katalog");
-    ablage.setOrt("/home/ulrich/Videos");
-    Store store = new Store();
-    File file = store.writeToFile(ablage);
+    Ablageort ort = new Ablageort();
+    ort.setName("Katalog");
+    ort.setOrt("/home/ulrich/Videos");
+    ort.setUrl("/media/test");
+    FileStorage store = new FileStorage(App.getInitParameter(App.getRs(App.RB_AP_CONF)));
+    File file = store.writeToFile(ort);
     try {
-      ConfigurationElement elem = store.readFromFile(file);
+      Entity elem = store.entityFromFile(file);
       logger.log(Level.INFO, "Typ: {0}, Name: {1}", 
               new Object[]{elem.getClass().getSimpleName(), elem.getName()});
     } catch (ClassNotFoundException ex) {

--
Gitblit v1.9.3