From a11f6c631aae9d0cd4414deea3da910b0e1da022 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Wed, 13 Nov 2024 16:53:54 +0000
Subject: [PATCH] Dokumentation in Arbeit

---
 src/de/uhilger/fm/Eraser.java |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/de/uhilger/fm/Eraser.java b/src/de/uhilger/fm/Eraser.java
index 9378b12..36a3a62 100644
--- a/src/de/uhilger/fm/Eraser.java
+++ b/src/de/uhilger/fm/Eraser.java
@@ -30,6 +30,9 @@
  * @author Ulrich Hilger, 15. Januar 2024
  */
 public class Eraser {
+  
+  public static final int OP_DELETE = 3;  
+  
   public String deleteFiles(String relPath, List<String> fileNames, String base) {
     String result = null;
     try {
@@ -41,8 +44,8 @@
           File targetFile = new File(targetDir, fileName);
           //logger.fine(targetFile.getAbsolutePath());
           if (targetFile.isDirectory()) {
-            CopyMoveVisitor bearbeiter = new CopyMoveVisitor();
-            bearbeiter.setOperation(Const.OP_DELETE);
+            FileOpsVisitor bearbeiter = new FileOpsVisitor();
+            bearbeiter.setOperation(OP_DELETE);
             Files.walkFileTree(targetFile.toPath(), bearbeiter);
           } else {
             /*
@@ -51,9 +54,9 @@
                 die so heissen, also z.B. alle [Dateiname]*.jpg
              */
             String fname = targetFile.getName().toLowerCase();
-            if (fname.endsWith(Const.JPEG)
-                    || fname.endsWith(Const.JPG)
-                    || fname.endsWith(Const.PNG)) {
+            if (fname.endsWith(ImageFileFilter.JPEG)
+                    || fname.endsWith(ImageFileFilter.JPG)
+                    || fname.endsWith(ImageFileFilter.PNG)) {
               deleteImgFiles(targetDir, targetFile);
             } else {
               targetFile.delete();

--
Gitblit v1.9.3