Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/PRFParser.java @ 1206:c7370734b872
Prevent parsing and storing PRF duplicates.
flys-backend/trunk@2315 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 11 Jul 2011 09:31:52 +0000 |
parents | 22858e7cca79 |
children |
comparison
equal
deleted
inserted
replaced
1205:5f1506fc7636 | 1206:c7370734b872 |
---|---|
38 | 38 |
39 public static final int MIN_YEAR = 1800; | 39 public static final int MIN_YEAR = 1800; |
40 public static final int MAX_YEAR = 2100; | 40 public static final int MAX_YEAR = 2100; |
41 | 41 |
42 public interface Callback { | 42 public interface Callback { |
43 void prfParsed(PRFParser parser); | 43 boolean prfAccept(File file); |
44 void prfParsed(PRFParser parser); | |
44 } // interface Parser | 45 } // interface Parser |
45 | 46 |
46 public static class DataFormat { | 47 public static class DataFormat { |
47 | 48 |
48 protected int deleteChars; | 49 protected int deleteChars; |
395 } | 396 } |
396 } | 397 } |
397 } | 398 } |
398 else if (file.isFile() | 399 else if (file.isFile() |
399 && file.getName().toLowerCase().endsWith(".prf") | 400 && file.getName().toLowerCase().endsWith(".prf") |
401 && (callback == null || callback.prfAccept(file)) | |
400 ) { | 402 ) { |
401 reset(); | 403 reset(); |
402 boolean success = parse(file); | 404 boolean success = parse(file); |
403 log.info("parsing " + (success ? "succeeded" : "failed")); | 405 log.info("parsing " + (success ? "succeeded" : "failed")); |
404 if (success && callback != null) { | 406 if (success && callback != null) { |