comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java @ 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 e2e615109a2e
comparison
equal deleted inserted replaced
4728:ccae8b43e527 4729:0df1cac6c4b5
62 62
63 63
64 /** Get the description of the cross section parsed. */ 64 /** Get the description of the cross section parsed. */
65 @Override 65 @Override
66 public String getDescription() { 66 public String getDescription() {
67 return removeExtension(getFileName()); 67 return FileTools.removeExtension(getFileName());
68 } 68 }
69 69
70 70
71 /** Get the year of this cross sections measurement. */ 71 /** Get the year of this cross sections measurement. */
72 @Override 72 @Override
82 @Override 82 @Override
83 public Map<Double, List<XY>> getData() { 83 public Map<Double, List<XY>> getData() {
84 return data; 84 return data;
85 } 85 }
86 86
87
88 /** Remove everything after dot from name. */
89 private static final String removeExtension(String name) {
90 int index = name.lastIndexOf('.');
91 return index == -1
92 ? name
93 : name.substring(0, index);
94 }
95 87
96 public void parseW80s(File root, final Callback callback) { 88 public void parseW80s(File root, final Callback callback) {
97 89
98 // TODO use the removeExtension/guess description and date. 90 // TODO use the removeExtension/guess description and date.
99 FileTools.walkTree(root, new FileTools.FileVisitor() { 91 FileTools.walkTree(root, new FileTools.FileVisitor() {

http://dive4elements.wald.intevation.org