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 {
}
}
public static CityDoctorModel parseCityGmlZipEntry(CityGmlZipEntry entry, ParserConfiguration config)
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();
if (config.getValidate()) {
......@@ -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)
......
......@@ -5,6 +5,7 @@ import de.hft.stuttgart.citydoctor2.parser.CityGmlParseException;
import de.hft.stuttgart.citydoctor2.parser.CityGmlParser;
import de.hft.stuttgart.citydoctor2.parser.InvalidGmlFileException;
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.Logger;
......@@ -35,6 +36,10 @@ public class CityGmlZipEntry implements Serializable {
}
public void loadEntry(ParserConfiguration config) {
loadEntry(config, null);
}
public void loadEntry(ParserConfiguration config, ProgressListener l) {
if (decompressed) {
return;
}
......@@ -43,7 +48,7 @@ public class CityGmlZipEntry implements Serializable {
return;
}
try {
this.model = CityGmlParser.parseCityGmlZipEntry(this, config);
this.model = CityGmlParser.parseCityGmlZipEntry(this, config, l);
this.decompressed = true;
} catch (CityGmlParseException | InvalidGmlFileException 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