# HG changeset patch # User Sascha L. Teichmann # Date 1342083703 0 # Node ID 509af52db23b26d50918d17df80bed6a55423aa3 # Parent 790c12c55abbea37fdf2c9fb27d81ca16506d8f0 Fix for issue 359 flys-backend/trunk@4946 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 790c12c55abb -r 509af52db23b flys-backend/ChangeLog --- 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 + + 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 * doc/schema/postgresql.sql, doc/schema/oracle.sql: diff -r 790c12c55abb -r 509af52db23b flys-backend/src/main/java/de/intevation/flys/importer/parsers/PRFParser.java --- 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());