[Dive4elements-commits] [PATCH 1 of 2] Removed removeExtension implementations, which have been moved to FileTools,

Wald Commits scm-commit at wald.intevation.org
Fri Dec 28 13:28:13 CET 2012


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1356698016 -3600
# Node ID 0df1cac6c4b5233260ca3c8094726207627098ab
# Parent  ccae8b43e527eb75e44fc48e24c6135c573de7a0
Removed removeExtension implementations, which have been moved to FileTools,
update callers.

diff -r ccae8b43e527 -r 0df1cac6c4b5 flys-backend/src/main/java/de/intevation/flys/importer/parsers/DA66Parser.java
--- 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.
diff -r ccae8b43e527 -r 0df1cac6c4b5 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	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());
 
diff -r ccae8b43e527 -r 0df1cac6c4b5 flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java
--- 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.


More information about the Dive4elements-commits mailing list