changeset 4729:0df1cac6c4b5

Removed removeExtension implementations, which have been moved to FileTools, update callers.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 28 Dec 2012 13:33:36 +0100
parents ccae8b43e527
children 1aca30035932
files flys-backend/src/main/java/de/intevation/flys/importer/parsers/DA66Parser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/PRFParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java
diffstat 3 files changed, 3 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/DA66Parser.java	Fri Dec 28 11:59:01 2012 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/DA66Parser.java	Fri Dec 28 13:33:36 2012 +0100
@@ -179,7 +179,7 @@
     /** Get the description of the cross section parsed. */
     @Override
     public String getDescription() {
-        return removeExtension(getFileName());
+        return FileTools.removeExtension(getFileName());
     }
 
 
@@ -200,14 +200,6 @@
     }
 
 
-    // TODO yet unused, use for description.
-    private static final String removeExtension(String name) {
-        int index = name.lastIndexOf('.');
-        return index == -1
-            ? name
-            : name.substring(0, index);
-    }
-
     public void parseDA66s(File root, final Callback callback) {
 
         // TODO use the removeExtension/guess description and date.
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/PRFParser.java	Fri Dec 28 11:59:01 2012 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/PRFParser.java	Fri Dec 28 13:33:36 2012 +0100
@@ -227,13 +227,6 @@
         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())) {
@@ -243,7 +236,7 @@
 
         log.info("parsing PRF file: '" + file + "'");
 
-        description = removeExtension(file.getName());
+        description = FileTools.removeExtension(file.getName());
 
         year = findYear(file.getName());
 
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java	Fri Dec 28 11:59:01 2012 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java	Fri Dec 28 13:33:36 2012 +0100
@@ -64,7 +64,7 @@
     /** Get the description of the cross section parsed. */
     @Override
     public String getDescription() {
-        return removeExtension(getFileName());
+        return FileTools.removeExtension(getFileName());
     }
 
 
@@ -85,14 +85,6 @@
     }
 
 
-    /** Remove everything after dot from name. */
-    private static final String removeExtension(String name) {
-        int index = name.lastIndexOf('.');
-        return index == -1
-            ? name
-            : name.substring(0, index);
-    }
-
     public void parseW80s(File root, final Callback callback) {
 
         // TODO use the removeExtension/guess description and date.

http://dive4elements.wald.intevation.org