From f61a32dab54add0f23e10a98ffe18d06f882c063 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Wed, 07 Apr 2021 22:08:38 +0000
Subject: [PATCH] Nachbesserungen

---
 src/de/uhilger/mediaz/store/FileStorage.java |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/src/de/uhilger/mediaz/store/FileStorage.java b/src/de/uhilger/mediaz/store/FileStorage.java
index 4b0ff1a..217420c 100644
--- a/src/de/uhilger/mediaz/store/FileStorage.java
+++ b/src/de/uhilger/mediaz/store/FileStorage.java
@@ -168,7 +168,7 @@
     }
     return list;
   }
-
+  
   @Override
   public TypeToken typeFromName(String name) {
     return types.get(name);
@@ -199,5 +199,23 @@
       return false;
     }
   }
+
+  @Override
+  public List<Entity> listObjects(String typ) {
+    File base = new File(fileBase);
+    File dir = new File(base, typ);
+    List<Entity> list = new ArrayList();
+    File[] files = dir.listFiles();
+    if(files != null) {
+      for(File file : files) {
+        try {
+          list.add(entityFromFile(file));
+        } catch (ClassNotFoundException | IOException ex) {
+          logger.log(Level.SEVERE, null, ex);
+        }
+      }
+    }
+    return list;
+  }
   
 }

--
Gitblit v1.9.3