Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/PRFParser.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 | 2f7a509f5acf |
children |
comparison
equal
deleted
inserted
replaced
4728:ccae8b43e527 | 4729:0df1cac6c4b5 |
---|---|
225 } | 225 } |
226 } | 226 } |
227 return null; | 227 return null; |
228 } | 228 } |
229 | 229 |
230 private static final String removeExtension(String name) { | |
231 int index = name.lastIndexOf('.'); | |
232 return index == -1 | |
233 ? name | |
234 : name.substring(0, index); | |
235 } | |
236 | |
237 public boolean parse(File file) { | 230 public boolean parse(File file) { |
238 | 231 |
239 if (!(file.isFile() && file.canRead())) { | 232 if (!(file.isFile() && file.canRead())) { |
240 log.warn("PRF: cannot open file '" + file + "'"); | 233 log.warn("PRF: cannot open file '" + file + "'"); |
241 return false; | 234 return false; |
242 } | 235 } |
243 | 236 |
244 log.info("parsing PRF file: '" + file + "'"); | 237 log.info("parsing PRF file: '" + file + "'"); |
245 | 238 |
246 description = removeExtension(file.getName()); | 239 description = FileTools.removeExtension(file.getName()); |
247 | 240 |
248 year = findYear(file.getName()); | 241 year = findYear(file.getName()); |
249 | 242 |
250 if (year == null) { | 243 if (year == null) { |
251 File parent = file.getParentFile(); | 244 File parent = file.getParentFile(); |