Commit 31399b0d authored by Riegel's avatar Riegel
Browse files

Feat!: Delete ErroneousEntry.java

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 2 additions and 28 deletions
+2 -28
......@@ -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();
......
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;
}
}
......@@ -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());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment