diff flys-backend/src/main/java/de/intevation/flys/importer/parsers/FlowVelocityModelParser.java @ 5689:a3f7da9bf0d1

Set description when importing flow velocity models
author Tom Gottfried <tom.gottfried@intevation.de>
date Fri, 12 Apr 2013 19:51:44 +0200
parents b3dd14fc13a6
children 53134ccc4a64
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/FlowVelocityModelParser.java	Fri Apr 12 15:08:14 2013 +0200
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/FlowVelocityModelParser.java	Fri Apr 12 19:51:44 2013 +0200
@@ -1,5 +1,8 @@
 package de.intevation.flys.importer.parsers;
 
+import java.io.File;
+import java.io.IOException;
+
 import java.math.BigDecimal;
 import java.text.NumberFormat;
 import java.text.ParseException;
@@ -49,6 +52,8 @@
 
     private ImportFlowVelocityModel current;
 
+    protected String description;
+
 
     public FlowVelocityModelParser() {
         models = new ArrayList<ImportFlowVelocityModel>();
@@ -60,14 +65,23 @@
     }
 
     @Override
+    public void parse(File file) throws IOException {
+        description = file.getName();
+
+        super.parse(file);
+    }
+
+    @Override
     protected void reset() {
-        current = new ImportFlowVelocityModel();
+        current = new ImportFlowVelocityModel(description);
     }
 
 
     @Override
     protected void finish() {
         models.add(current);
+
+	//	description = null;
     }
 
 

http://dive4elements.wald.intevation.org