changeset 4716:6016b9aa827a

Adjust callbacks after Parsers new interface implementation, re-enable file hashing for da66s.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 19 Dec 2012 14:59:55 +0100
parents 2f7a509f5acf
children e67d396ed65d
files flys-backend/src/main/java/de/intevation/flys/importer/ImportRiver.java
diffstat 1 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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();

http://dive4elements.wald.intevation.org