[Dive4elements-commits] [PATCH 4 of 4] Adjust callbacks after Parsers new interface implementation, re-enable file hashing for da66s

Wald Commits scm-commit at wald.intevation.org
Wed Dec 19 14:54:22 CET 2012


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1355925595 -3600
# Node ID 6016b9aa827aab6bf396be0a4ea32dc1c563f8d8
# Parent  2f7a509f5acff725e918041d17d50d05dc3d75f3
Adjust callbacks after Parsers new interface implementation, re-enable file hashing for da66s.

diff -r 2f7a509f5acf -r 6016b9aa827a flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java	Wed Dec 19 14:59:14 2012 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java	Wed Dec 19 14:59:55 2012 +0100
@@ -22,6 +22,7 @@
 import de.intevation.flys.importer.parsers.AnnotationsParser;
 import de.intevation.flys.importer.parsers.BedHeightEpochParser;
 import de.intevation.flys.importer.parsers.BedHeightSingleParser;
+import de.intevation.flys.importer.parsers.CrossSectionParser;
 import de.intevation.flys.importer.parsers.DA66Parser;
 import de.intevation.flys.importer.parsers.FlowVelocityMeasurementParser;
 import de.intevation.flys.importer.parsers.FlowVelocityModelParser;
@@ -100,7 +101,6 @@
 
     public static final String MINFO_SQ_DIR = "Feststofftransport-Abfluss-Beziehung";
 
-
     protected String name;
 
     protected File   wstFile;
@@ -902,26 +902,22 @@
             .getParentFile()  // Hydrologie
             .getParentFile(); // <river>
 
-        parser.parseDA66s(riverDir, new DA66Parser.Callback() {
+        parser.parseDA66s(riverDir, new CrossSectionParser.Callback() {
 
             Set<HashedFile> da66s = new HashSet<HashedFile>();
 
             @Override
-            public boolean da66Accept(File file) {
+            public boolean accept(File file) {
                 HashedFile hf = new HashedFile(file);
                 boolean success = da66s.add(hf);
-                return true;
-                // TODO for some reason they are all duplicates, reenable the check!
-                /*
                 if (!success) {
                     log.warn("DA66 file '" + file + "' seems to be a duplicate.");
                 }
                 return success;
-                */
             }
 
             @Override
-            public void da66Parsed(DA66Parser parser) {
+            public void parsed(CrossSectionParser parser) {
                 log.debug("callback from DA66 parser");
 
                 // TODO populate with real-world data
@@ -964,8 +960,9 @@
 
             Set<HashedFile> prfs = new HashSet<HashedFile>();
 
+            // TODO merge Callback implementation with DA66 one.
             @Override
-            public boolean prfAccept(File file) {
+            public boolean accept(File file) {
                 HashedFile hf = new HashedFile(file);
                 boolean success = prfs.add(hf);
                 if (!success) {
@@ -975,7 +972,7 @@
             }
 
             @Override
-            public void prfParsed(PRFParser parser) {
+            public void parsed(CrossSectionParser parser) {
                 log.debug("callback from PRF parser");
 
                 String  description = parser.getDescription();


More information about the Dive4elements-commits mailing list