Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/uinfo/UInfoImporter.java @ 9012:abe069eb180c
Import of vegetation zones added
author | mschaefer |
---|---|
date | Wed, 18 Apr 2018 07:43:55 +0200 |
parents | d046997281bc |
children | 63c086139391 |
comparison
equal
deleted
inserted
replaced
9011:a44200bf0547 | 9012:abe069eb180c |
---|---|
17 | 17 |
18 import org.apache.log4j.Logger; | 18 import org.apache.log4j.Logger; |
19 import org.dive4elements.river.importer.ImportRiver; | 19 import org.dive4elements.river.importer.ImportRiver; |
20 import org.dive4elements.river.importer.common.ImportParser; | 20 import org.dive4elements.river.importer.common.ImportParser; |
21 import org.dive4elements.river.importer.uinfo.parsers.SalixParser; | 21 import org.dive4elements.river.importer.uinfo.parsers.SalixParser; |
22 import org.dive4elements.river.importer.uinfo.parsers.VegetationParser; | |
22 | 23 |
23 /** | 24 /** |
24 * Import all S-INFO files of a river from its import directory and subdirectories<br /> | 25 * Import all U-INFO files of a river from its import directory and subdirectories<br /> |
25 * <br /> | 26 * <br /> |
26 * Requires river and its gauges to exist in the database already | 27 * Requires river and its gauges to exist in the database already |
27 * | 28 * |
28 * @author Matthias Schäfer | 29 * @author Matthias Schäfer |
29 * | 30 * |
36 | 37 |
37 private static final String UINFO_DIR = "Oekologie"; | 38 private static final String UINFO_DIR = "Oekologie"; |
38 | 39 |
39 private enum UInfoDirName { | 40 private enum UInfoDirName { |
40 BASICS("Basisdaten"), // | 41 BASICS("Basisdaten"), // |
41 SALIX("Salix-Linie" + File.separator + "Salix-Linie"); | 42 SALIX("Salix-Linie" + File.separator + "Salix-Linie"), // |
43 VEGETATION("Vegetationszonen"); | |
42 | 44 |
43 private final String dirname; | 45 private final String dirname; |
44 | 46 |
45 UInfoDirName(final String dirname) { | 47 UInfoDirName(final String dirname) { |
46 this.dirname = dirname; | 48 this.dirname = dirname; |
89 log.info("Salix: no files found"); | 91 log.info("Salix: no files found"); |
90 } | 92 } |
91 else { | 93 else { |
92 log.info("Salix: skipped"); | 94 log.info("Salix: skipped"); |
93 } | 95 } |
96 if (!VegetationParser.shallSkip()) { | |
97 if (!this.parsers.addAll(VegetationParser.createParsers(UInfoDirName.VEGETATION.buildPath(this.rootDir), UInfoDirName.VEGETATION.getFile(), river))) | |
98 log.info("Vegetation: no files found"); | |
99 } | |
100 else { | |
101 log.info("Vegetation: skipped"); | |
102 } | |
94 } | 103 } |
95 | 104 |
96 /** | 105 /** |
97 * Imports the files according to the active parser list | 106 * Imports the files according to the active parser list |
98 */ | 107 */ |