Commit 59072f60 authored by Riegel's avatar Riegel
Browse files

Refactor: Add support for optional Progresslistener

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 13 additions and 2 deletions
+13 -2
...@@ -206,8 +206,14 @@ public class CityGmlParser { ...@@ -206,8 +206,14 @@ public class CityGmlParser {
} }
} }
public static CityDoctorModel parseCityGmlZipEntry(CityGmlZipEntry entry, ParserConfiguration config) public static CityDoctorModel parseCityGmlZipEntry(CityGmlZipEntry entry, ParserConfiguration config)
throws CityGmlParseException, InvalidGmlFileException, IOException { throws CityGmlParseException, InvalidGmlFileException, IOException {
return parseCityGmlZipEntry(entry, config, null);
}
public static CityDoctorModel parseCityGmlZipEntry(CityGmlZipEntry entry, ParserConfiguration config, ProgressListener l)
throws CityGmlParseException, InvalidGmlFileException, IOException {
CityGMLContext context = getContext(); CityGMLContext context = getContext();
if (config.getValidate()) { if (config.getValidate()) {
...@@ -221,7 +227,7 @@ public class CityGmlParser { ...@@ -221,7 +227,7 @@ public class CityGmlParser {
} }
} }
return decompressAndParseCityGmlEntry(entry, config, context); return decompressAndParseCityGmlEntry(entry, config, l, context);
} }
public static CityDoctorModel decompressAndParseCityGmlEntry(CityGmlZipEntry entry, ParserConfiguration config, CityGMLContext context) public static CityDoctorModel decompressAndParseCityGmlEntry(CityGmlZipEntry entry, ParserConfiguration config, CityGMLContext context)
......
...@@ -5,6 +5,7 @@ import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException; ...@@ -5,6 +5,7 @@ import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParser; import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException; import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration; import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
import de.hft.stuttgart.citydoctor2.parser.ProgressListener;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -35,6 +36,10 @@ public class CityGmlZipEntry implements Serializable { ...@@ -35,6 +36,10 @@ public class CityGmlZipEntry implements Serializable {
} }
public void loadEntry(ParserConfiguration config) { public void loadEntry(ParserConfiguration config) {
loadEntry(config, null);
}
public void loadEntry(ParserConfiguration config, ProgressListener l) {
if (decompressed) { if (decompressed) {
return; return;
} }
...@@ -43,7 +48,7 @@ public class CityGmlZipEntry implements Serializable { ...@@ -43,7 +48,7 @@ public class CityGmlZipEntry implements Serializable {
return; return;
} }
try { try {
this.model = CityGmlParser.parseCityGmlZipEntry(this, config); this.model = CityGmlParser.parseCityGmlZipEntry(this, config, l);
this.decompressed = true; this.decompressed = true;
} catch (CityGmlParseException | InvalidGmlFileException e) { } catch (CityGmlParseException | InvalidGmlFileException e) {
logger.error(e); logger.error(e);
......
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