"git@transfer.hft-stuttgart.de:citydoctor/citydoctor2.git" did not exist on "02de0a22c694e87ccc104d604ec91907548d99be"
Commit 8dffaa6a authored by Riegel's avatar Riegel
Browse files

Refactor: Cleanup code

parent cdc6fd14
Showing with 4 additions and 8 deletions
+4 -8
......@@ -27,9 +27,7 @@ public class CityGmlArchive {
@Serial
private static final long serialVersionUID = 2168389511043362615L;
private List<CityGmlZipEntry> entries;
private boolean validated = false;
private final List<CityGmlZipEntry> entries;
public static CityGmlArchive fromZipFile(String zipFile, ParserConfiguration config) {
ArrayList<CityGmlZipEntry> archiveEntries = new ArrayList<>();
......@@ -48,9 +46,9 @@ public class CityGmlArchive {
}
}
} catch (IOException e) {
throw new RuntimeException(e);
logger.error(e);
} catch (Exception e){
// Catch and rethrow Exception to ensure tmpDir deletion
// Catch and rethrow other Exceptions to ensure tmpDir deletion in finally block
throw e;
} finally {
if (tmpDir != null) {
......@@ -61,7 +59,7 @@ public class CityGmlArchive {
}
}
}
logger.info("Parsed zip-archive with {} entries", archiveEntries.size());
logger.info("Zip-archive successfully uncompressed, {} CityGml files detected", archiveEntries.size());
return new CityGmlArchive(archiveEntries);
}
......@@ -74,12 +72,10 @@ public class CityGmlArchive {
}
public void checkEntries(){
validated = false;
for(CityGmlZipEntry entry : entries){
Checker checker = new Checker(entry.getModel());
checker.runChecks();
}
validated = true;
}
public List<CityGmlZipEntry> getEntries() {
......
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