From 31399b0d50d1bdf80b6998ce68895e1444c9a2e1 Mon Sep 17 00:00:00 2001 From: Riegel <alexander.riegel@hft-stuttgart.de> Date: Tue, 10 Dec 2024 11:31:09 +0100 Subject: [PATCH] Feat!: Delete ErroneousEntry.java --- .../citydoctor2/utils/ArchivePacker.java | 3 +-- .../citydoctor2/zip/ErroneousEntry.java | 25 ------------------- .../stuttgart/citydoctor2/zip/ZipTest.java | 2 +- 3 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/ErroneousEntry.java diff --git a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/ArchivePacker.java b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/ArchivePacker.java index 239a5eb..947697e 100644 --- a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/ArchivePacker.java +++ b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/utils/ArchivePacker.java @@ -3,7 +3,6 @@ package de.hft.stuttgart.citydoctor2.utils; import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel; import de.hft.stuttgart.citydoctor2.zip.CityGmlZipArchive; import de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry; -import de.hft.stuttgart.citydoctor2.zip.ErroneousEntry; import org.apache.commons.io.FileUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -32,7 +31,7 @@ public class ArchivePacker { tmpDir = Files.createTempDirectory("zipTmp"); tmpDir.toFile().deleteOnExit(); for (CityGmlZipEntry entry : archive.getEntries()) { - if (entry instanceof ErroneousEntry){ + if (entry.getErrorType() != null){ continue; } CityDoctorModel model = entry.getModel(); diff --git a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/ErroneousEntry.java b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/ErroneousEntry.java deleted file mode 100644 index 16bdd0c..0000000 --- a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/ErroneousEntry.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.hft.stuttgart.citydoctor2.zip; - -import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel; - -import java.util.zip.ZipEntry; - -public class ErroneousEntry extends CityGmlZipEntry { - - private ZipEntryErrorType errorType = null; - - public ErroneousEntry(String filename, ZipEntryErrorType errorType){ - super(filename, true); - this.errorType = errorType; - } - - - @Override - public CityDoctorModel getModel(){ - return null; - } - - public ZipEntryErrorType getErrorType() { - return errorType; - } -} diff --git a/CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/zip/ZipTest.java b/CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/zip/ZipTest.java index 0dd4439..cbd09cb 100644 --- a/CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/zip/ZipTest.java +++ b/CityDoctorParent/CityDoctorModel/src/test/java/de/hft/stuttgart/citydoctor2/zip/ZipTest.java @@ -34,7 +34,7 @@ public class ZipTest { for (CityGmlZipEntry entry : cgmlArch.getEntries()) { assertNotNull(entry); assertTrue(entry.getFileName().matches("^mock[1-5].gml$")); - assertFalse(entry instanceof ErroneousEntry); + assertNull(entry.getErrorType()); assertNotNull(entry.getModel()); assertEquals(1, entry.getModel().getNumberOfFeatures()); } -- GitLab