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

Refactor: Rename getFileName() function

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