From b659da052d5cd75bae7b7ee1e82c222fae2c5377 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Thu, 14 Nov 2024 11:38:07 +0000
Subject: [PATCH] Hinweis auf Gson aufgenommen.
---
src/de/uhilger/fm/Inflator.java | 38 ++++++++++++++++++++++----------------
1 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/src/de/uhilger/fm/Inflator.java b/src/de/uhilger/fm/Inflator.java
index 22dd48e..4957baa 100644
--- a/src/de/uhilger/fm/Inflator.java
+++ b/src/de/uhilger/fm/Inflator.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
@@ -26,18 +26,23 @@
import java.util.zip.ZipFile;
/**
- * Eine Klasse mit Methoden zum entpacken von Dateien
+ * Entpacken von Dateien
*
* @author Ulrich Hilger, 15. Januar 2024
*/
public class Inflator {
- /* --------- ZIP entpacken ---------------- */
-
- public String extractZipfile(String fName, String relPath, String base) {
+ /**
+ * Eine Zip-Datei entpacken
+ *
+ * @param fName Name der Zip-Datei
+ * @param base absoluter Pfad des Ablageortes der Zip-Datei
+ * @return 'ok', wenn erfolgreich oder Fehlermeldung, wenn nicht
+ */
+ public String extractZipfile(String fName, /*String relPath, */String base) {
//logger.fine("fName: " + fName + ", relPath: " + relPath);
String result = null;
- if (!relPath.startsWith(".")) {
+// if (!relPath.startsWith(".")) {
try {
//File targetDir = new File(fileBase, relPath);
//File targetDir = getTargetDir(relPath);
@@ -51,17 +56,17 @@
result = ex.getLocalizedMessage();
//logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
}
- } else {
- result = "Falsche relative Pfadangabe.";
- }
+// } else {
+// result = "Falsche relative Pfadangabe.";
+// }
return result;
}
/**
- * extract a given ZIP archive to the folder respective archive resides in
+ * Eine Datei in den Ordner entpacken, in dem sie liegt
*
- * @param archive the archive to extract
- * @throws Exception
+ * @param archive die zu entpackende Zip-Datei
+ * @throws Exception wenn etwas schief geht
*/
private boolean extract(File archive) throws Exception {
ZipFile zipfile = new ZipFile(archive);
@@ -76,11 +81,12 @@
/**
* unzip a given entry of a given zip file to a given location
+ * Einen Eintrag in einer ZIP-Datei an einen gegebenen Ausgabeort extrahieren
*
- * @param zipfile the zip file to read an entry from
- * @param zipentry the zip entry to read
- * @param destPath the path to the destination location for the extracted content
- * @throws IOException
+ * @param zipfile die Zip-Datei, aus der ein zu entpackender Eintrag gelesen werden soll
+ * @param zipentry der Eintrag, der entpackt werden soll
+ * @param destPath der Pfad zum Ausgabeort
+ * @throws IOException wenn etwas schief geht
*/
private void unzip(ZipFile zipfile, ZipEntry zipentry, String destPath) throws IOException {
byte buf[] = new byte[1024];
--
Gitblit v1.9.3