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 |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/de/uhilger/fm/Eraser.java b/src/de/uhilger/fm/Eraser.java
index 0ecea3d..36a3a62 100644
--- a/src/de/uhilger/fm/Eraser.java
+++ b/src/de/uhilger/fm/Eraser.java
@@ -1,5 +1,5 @@
 /*
-  neon-fm - File management extensions to Neon
+  fm - File management class library
   Copyright (C) 2024  Ulrich Hilger
 
   This program is free software: you can redistribute it and/or modify
@@ -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()) {
-            OrdnerBearbeiter bearbeiter = new OrdnerBearbeiter();
-            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