Commit ac539686 authored by Riegel's avatar Riegel
Browse files

Fix: Parsing of LibraryObjects in CityGmlZipArchive

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 10 additions and 3 deletions
+10 -3
......@@ -823,7 +823,8 @@ public class Citygml3FeatureMapper extends ObjectWalker {
libObj = LibraryObject.of(libraryObjectPath, config);
} else {
String libraryObjectPath = ig.getLibraryObject();
CityGmlZipEntry libEntry = zipEntry.getArchive().getEntry(libraryObjectPath);
Path loPath = zipEntry.resolveLibraryObjectPath(libraryObjectPath);
CityGmlZipEntry libEntry = zipEntry.getArchive().getEntry(loPath.toString());
libObj = LibraryObject.of(libEntry, config);
}
if (libObj != null) {
......
......@@ -12,6 +12,7 @@ import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.io.Serial;
import java.io.Serializable;
import java.nio.file.Path;
import java.util.zip.ZipEntry;
public class CityGmlZipEntry implements Serializable {
......@@ -20,6 +21,7 @@ public class CityGmlZipEntry implements Serializable {
@Serial
private static final long serialVersionUID = -5732913269959043262L;
private final Path filePath;
private final String fileName;
private final String displayName;
private transient CityDoctorModel model;
......@@ -91,8 +93,8 @@ public class CityGmlZipEntry implements Serializable {
protected CityGmlZipEntry(ZipEntry entry, CityGmlZipArchive parentArchive, boolean decompressed) {
this.fileName = entry.getName();
String[] nameSplits = fileName.split("/");
this.displayName = nameSplits[nameSplits.length - 1];
this.filePath = Path.of(entry.getName());
this.displayName = filePath.getFileName().toString();
if (entry.getSize() != -1) {
this.fileSize = entry.getSize();
}
......@@ -129,6 +131,10 @@ public class CityGmlZipEntry implements Serializable {
fileSize = size;
}
public Path resolveLibraryObjectPath(String libraryObjectPath) {
return filePath.getParent().resolve(libraryObjectPath);
}
public boolean isDecompressed() {
return decompressed;
}
......
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