changeset 3340:509af52db23b

Fix for issue 359 flys-backend/trunk@4946 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 12 Jul 2012 09:01:43 +0000
parents 790c12c55abb
children 51f037483071
files flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/importer/parsers/PRFParser.java
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Wed Jul 11 10:37:03 2012 +0000
+++ b/flys-backend/ChangeLog	Thu Jul 12 09:01:43 2012 +0000
@@ -1,3 +1,10 @@
+2012-07-11	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	Fix for flys/issue359
+
+	* src/main/java/de/intevation/flys/importer/parsers/PRFParser.java:
+	  Removed extension from PRF descriptions.
+
 2012-07-11	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* doc/schema/postgresql.sql, doc/schema/oracle.sql:
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/PRFParser.java	Wed Jul 11 10:37:03 2012 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/PRFParser.java	Thu Jul 12 09:01:43 2012 +0000
@@ -224,6 +224,13 @@
         return null;
     }
 
+    private static final String removeExtension(String name) {
+        int index = name.lastIndexOf('.');
+        return index == -1
+            ? name
+            : name.substring(0, index);
+    }
+
     public boolean parse(File file) {
 
         if (!(file.isFile() && file.canRead())) {
@@ -233,7 +240,7 @@
 
         log.info("parsing PRF file: '" + file + "'");
 
-        description = file.getName();
+        description = removeExtension(file.getName());
 
         year = findYear(file.getName());
 

http://dive4elements.wald.intevation.org