Commit 55b90c0f authored by Riegel's avatar Riegel
Browse files

Feat: Add getDisplayName()

Added the getDisplayName() function, which returns the filename without
the zipfile subpath prefix
parent e79395ee
...@@ -20,6 +20,7 @@ public class CityGmlZipEntry implements Serializable { ...@@ -20,6 +20,7 @@ public class CityGmlZipEntry implements Serializable {
private static final long serialVersionUID = -5732913269959043262L; private static final long serialVersionUID = -5732913269959043262L;
private final String fileName; private final String fileName;
private final String displayName;
private transient CityDoctorModel model; private transient CityDoctorModel model;
private CityGmlZipArchive parentArchive; private CityGmlZipArchive parentArchive;
private boolean decompressed; private boolean decompressed;
...@@ -85,6 +86,8 @@ public class CityGmlZipEntry implements Serializable { ...@@ -85,6 +86,8 @@ public class CityGmlZipEntry implements Serializable {
protected CityGmlZipEntry(ZipEntry entry, CityGmlZipArchive parentArchive, boolean decompressed) { protected CityGmlZipEntry(ZipEntry entry, CityGmlZipArchive parentArchive, boolean decompressed) {
this.fileName = entry.getName(); this.fileName = entry.getName();
String[] nameSplits = fileName.split("/");
this.displayName = nameSplits[nameSplits.length - 1];
if (entry.getSize() != -1) { if (entry.getSize() != -1) {
this.fileSize = entry.getSize(); this.fileSize = entry.getSize();
} }
...@@ -105,6 +108,10 @@ public class CityGmlZipEntry implements Serializable { ...@@ -105,6 +108,10 @@ public class CityGmlZipEntry implements Serializable {
return fileName; return fileName;
} }
public String getDisplayName() {
return displayName;
}
public ZipEntryErrorType getErrorType() { public ZipEntryErrorType getErrorType() {
return errorType; return errorType;
} }
......
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