From 516d0b6c2f2ab35a59b123d9fbe6958da8458583 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Wed, 20 Nov 2024 12:20:52 +0000
Subject: [PATCH] Dokumentation in Arbeit: FileEraser fertig dokumentiert, kleinere Anpassungen

---
 src/de/uhilger/neon/fm/FileManipulator.java |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/de/uhilger/neon/fm/FileManipulator.java b/src/de/uhilger/neon/fm/FileManipulator.java
index 1026507..d643b9a 100644
--- a/src/de/uhilger/neon/fm/FileManipulator.java
+++ b/src/de/uhilger/neon/fm/FileManipulator.java
@@ -58,14 +58,14 @@
 
   public void run(HttpExchange exchange) {
     try {
-      super.run(exchange);
+      init(exchange);
       String query = exchange.getRequestURI().getQuery();
       if (query != null) {
         String[] params = query.split(FileServer.STR_EQUAL);
         switch (params[0]) {
           case P_RENAME:
             h.inspectFileName(params[1]);
-            String neuerDateiName = new Renamer().umbenennen(exchange, fileName, params[1], file);
+            String neuerDateiName = new Renamer().rename(/*fileName, */params[1], file);
             antwort(exchange, HttpResponder.SC_OK, neuerDateiName);
             break;
           case P_COPY:
@@ -84,12 +84,12 @@
             }
             break;
           case P_ZIP:
-            String path = exchange.getRequestURI().toString();
-            zipAntwort(exchange, new Deflator().packFolder(fileName, path, base));
+            //String path = exchange.getRequestURI().toString();
+            zipAntwort(exchange, new Deflator().packFolder(fileName, /*path, */base));
             break;
           case P_UNZIP:
-            path = exchange.getRequestURI().toString();
-            zipAntwort(exchange, new Inflator().extractZipfile(fileName, path, base));
+            //String path = exchange.getRequestURI().toString();
+            zipAntwort(exchange, new Inflator().extractZipfile(fileName, /*path,*/ base));
             break;
           default:
             antwort(exchange, HttpResponder.SC_NOT_FOUND, "ungueltige Anfrage");
@@ -111,7 +111,12 @@
 
   private void copyOrMove(HttpExchange exchange, String quelle, String ziel, int op) throws IOException {
     String[] dateiNamen = dateiliste(exchange);
-    new Mover().copyOrMoveFiles(quelle, ziel, dateiNamen, op, base);
+    if(op == Mover.OP_COPY) {
+      new Mover().copy(quelle, ziel, dateiNamen, base);
+    } else {
+      new Mover().move(quelle, ziel, dateiNamen, base);
+    }            
+    //new Mover().copyOrMoveFiles(quelle, ziel, dateiNamen, op, base);
     antwort(exchange, HttpResponder.SC_OK, "Dateien verarbeitet.");
   }
 

--
Gitblit v1.9.3