comparison backend/src/main/java/org/dive4elements/river/importer/parsers/InfoGewParser.java @ 8677:b44c76b6800c

Importer, do not jump knowingly over the cliff.
author Tom Gottfried <tom@intevation.de>
date Thu, 09 Apr 2015 19:27:54 +0200
parents 24408bce2fdb
children 5e38e2924c07
comparison
equal deleted inserted replaced
8676:571c0e4321bd 8677:b44c76b6800c
115 File wst = new File(wstFilename = normalize(wstFilename)); 115 File wst = new File(wstFilename = normalize(wstFilename));
116 if (!wst.isAbsolute()) { 116 if (!wst.isAbsolute()) {
117 wst = new File(root, wstFilename); 117 wst = new File(root, wstFilename);
118 } 118 }
119 wst = FileTools.repair(wst); 119 wst = FileTools.repair(wst);
120 log.info("Found wst file '" + wst + "'");
121 if (!wst.isFile() || !wst.canRead()) { 120 if (!wst.isFile() || !wst.canRead()) {
122 log.error("cannot access WST file '" + wstFilename + "'"); 121 log.error("cannot access WST file '" + wstFilename + "'");
123 continue; 122 continue;
124 } 123 }
124 log.info("Found wst file '" + wst + "'");
125 wstFile = wst; 125 wstFile = wst;
126 } 126 }
127 else if ((m = GEW_UUID.matcher(line)).matches()) { 127 else if ((m = GEW_UUID.matcher(line)).matches()) {
128 modelUuid = m.group(1); 128 modelUuid = m.group(1);
129 log.debug("Found model uuid " + modelUuid + 129 log.debug("Found model uuid " + modelUuid +
133 //TODO: Make it relative to the wst file. 133 //TODO: Make it relative to the wst file.
134 String bbInfo = m.group(1); 134 String bbInfo = m.group(1);
135 bbInfoFile = new File(normalize(bbInfo)); 135 bbInfoFile = new File(normalize(bbInfo));
136 } 136 }
137 } 137 }
138 if (riverName != null) { 138 if (riverName != null && wstFile != null) {
139 rivers.add(new ImportRiver( 139 rivers.add(new ImportRiver(
140 riverName, 140 riverName,
141 modelUuid, 141 modelUuid,
142 wstFile, 142 wstFile,
143 bbInfoFile, 143 bbInfoFile,

http://dive4elements.wald.intevation.org