Commit 8a154830 authored by Riegel's avatar Riegel
Browse files

Refactor: Rename getFileName() function

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 13 additions and 13 deletions
+13 -13
......@@ -42,7 +42,7 @@ public class LibraryObject extends Geometry {
}
public static LibraryObject of(CityGmlZipEntry entry, ParserConfiguration config) {
String fileName = entry.getFileName();
String fileName = entry.getFullFileName();
if (libraryObjects.containsKey(fileName)){
return libraryObjects.get(fileName);
}
......@@ -89,7 +89,7 @@ public class LibraryObject extends Geometry {
logger.error(e.getStackTrace());
} catch (CityGmlParseException e) {
logger.error(String.format(
"Encountered an error while parsing library object %s", entry.getFileName()));
"Encountered an error while parsing library object %s", entry.getFullFileName()));
logger.error(e.getStackTrace());
}
return geo;
......
......@@ -96,7 +96,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
this.config = config;
this.directory = null;
this.zipEntry = entry;
model = new CityDoctorModel(config, Path.of(entry.getFileName()).toFile());
model = new CityDoctorModel(config, Path.of(entry.getFullFileName()).toFile());
neighborDistance = 1.8d / Math.pow(10, config.getNumberOfRoundingPlaces());
}
......
......@@ -35,7 +35,7 @@ public class ArchivePacker {
continue;
}
CityDoctorModel model = entry.getModel();
String filename = tmpDir.toString() + File.separator + entry.getFileName();
String filename = tmpDir.toString() + File.separator + entry.getFullFileName();
model.saveAs(filename, model.isValidated());
}
zipDirectory(targetPath, tmpDir.toString());
......
......@@ -89,7 +89,7 @@ public class CityGmlZipArchive implements Serializable {
public CityGmlZipEntry getEntry(String fileName) {
fileName = stripArchivePath(fileName);
for (CityGmlZipEntry entry : entries) {
String entryName = stripArchivePath(entry.getFileName());
String entryName = stripArchivePath(entry.getFullFileName());
if (entryName.equals(fileName)) {
return entry;
}
......
......@@ -109,7 +109,7 @@ public class CityGmlZipEntry implements Serializable {
return parentArchive;
}
public String getFileName() {
public String getFullFileName() {
return fileName;
}
......
......@@ -15,7 +15,7 @@ public class CityGmlZipEntryFile implements AutoCloseable {
public CityGmlZipEntryFile(CityGmlZipEntry entry) throws IOException {
CityGmlZipArchive archive = entry.getArchive();
zip = new ZipFile(archive.getArchivePath().toFile());
zipEntry = zip.getEntry(entry.getFileName());
zipEntry = zip.getEntry(entry.getFullFileName());
this.cgmlZipEntry = entry;
}
......
......@@ -32,7 +32,7 @@ public class ZipTest {
assertEquals(5, cgmlArch.getEntries().size());
for (CityGmlZipEntry entry : cgmlArch.getEntries()) {
assertNotNull(entry);
assertTrue(entry.getFileName().matches("^mock[1-5].gml$"));
assertTrue(entry.getFullFileName().matches("^mock[1-5].gml$"));
assertNull(entry.getErrorType());
assertNotNull(entry.getModel());
assertEquals(1, entry.getModel().getNumberOfFeatures());
......
......@@ -751,9 +751,9 @@ public class Checker {
for (CityGmlZipEntry entry : archive.getEntries()) {
String xmlOutput = xmlDirectory == null ? null : xmlDirectory + entry.getFileName().replaceFirst("\\..+", ".xml");
String pdfOutput = pdfDirectory == null ? null : pdfDirectory + entry.getFileName().replaceFirst("\\..+", ".pdf");
String outputFile = outputDirectory == null ? null : outputDirectory + entry.getFileName();
String xmlOutput = xmlDirectory == null ? null : xmlDirectory + entry.getFullFileName().replaceFirst("\\..+", ".xml");
String pdfOutput = pdfDirectory == null ? null : pdfDirectory + entry.getFullFileName().replaceFirst("\\..+", ".pdf");
String outputFile = outputDirectory == null ? null : outputDirectory + entry.getFullFileName();
streamCheck(entry, xmlOutput, pdfOutput, config, l, outputFile);
}
if (outputDirectory != null) {
......@@ -772,7 +772,7 @@ public class Checker {
try (BufferedOutputStream xmlBos = getXmlOutputMaybe(xmlOutput);
BufferedOutputStream pdfBos = getPdfOutputMaybe(pdfOutput)) {
Checker c = new Checker(config, null);
String fileName = entry.getFileName();
String fileName = entry.getFullFileName();
// create reporter if available
XmlStreamReporter xmlReporter = getXmlReporter(config, xmlBos, fileName);
......
......@@ -263,7 +263,7 @@ public class ZipEntryManager {
}
private void showMetadata(CityGmlZipEntry entry) {
subpathValueTxt.setText(entry.getFileName());
subpathValueTxt.setText(entry.getFullFileName());
if (entry.getFileSize() != -1L) {
long fileSize = entry.getFileSize();
long kb = 1024L;
......
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