From 8f4ae98add68efc19b825d0ce0c7cde5f90b2325 Mon Sep 17 00:00:00 2001 From: ulrich Date: Wed, 13 Nov 2024 17:01:05 +0000 Subject: [PATCH] Const entfernt --- /dev/null | 28 ---------------------------- src/de/uhilger/fm/Eraser.java | 6 ++++-- src/de/uhilger/fm/Deflator.java | 4 +++- 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/src/de/uhilger/fm/Const.java b/src/de/uhilger/fm/Const.java deleted file mode 100644 index 1ac26db..0000000 --- a/src/de/uhilger/fm/Const.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - fm - File management class library - Copyright (C) 2024 Ulrich Hilger - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. - */ -package de.uhilger.fm; - -/** - * - * @author Ulrich Hilger - * @version 0.1, 08.11.2024 - */ -public class Const { - public static final String STR_SLASH = "/"; - public static final String STR_DOT = "."; -} diff --git a/src/de/uhilger/fm/Deflator.java b/src/de/uhilger/fm/Deflator.java index 7a3b60b..b4e3689 100644 --- a/src/de/uhilger/fm/Deflator.java +++ b/src/de/uhilger/fm/Deflator.java @@ -32,6 +32,8 @@ * @author Ulrich Hilger, 15. Januar 2024 */ public class Deflator { + + private final String STR_SLASH = "/"; /* --------------- Ordner packen ----------------- */ /** @@ -51,7 +53,7 @@ try { //String fName = getFileName(e); //logger.fine("fName: " + fName); - if (fName.endsWith(Const.STR_SLASH)) { + if (fName.endsWith(STR_SLASH)) { File dir = new File(base, fName); if (dir.isDirectory()) { //logger.fine("absPath: " + dir.getAbsolutePath()); diff --git a/src/de/uhilger/fm/Eraser.java b/src/de/uhilger/fm/Eraser.java index 36a3a62..3df2242 100644 --- a/src/de/uhilger/fm/Eraser.java +++ b/src/de/uhilger/fm/Eraser.java @@ -33,11 +33,13 @@ public static final int OP_DELETE = 3; + private final String STR_DOT = "."; + public String deleteFiles(String relPath, List<String> fileNames, String base) { String result = null; try { //logger.fine(fileNames.toString()); - if (!relPath.startsWith(Const.STR_DOT)) { + if (!relPath.startsWith(STR_DOT)) { File targetDir = new File(base, relPath); // getTargetDir(relPath); //logger.fine("targetDir: " + targetDir); for (String fileName : fileNames) { @@ -73,7 +75,7 @@ private void deleteImgFiles(File targetDir, File targetFile) throws IOException { String fnameext = targetFile.getName(); - int dotpos = fnameext.lastIndexOf(Const.STR_DOT); + int dotpos = fnameext.lastIndexOf(STR_DOT); String fname = fnameext.substring(0, dotpos); String ext = fnameext.substring(dotpos); //logger.fine("fname: " + fname + ", ext: " + ext); -- Gitblit v1.9.3