Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/parsers/StaFileParser.java @ 6333:b58a71a5720c
Backend: Removed cruft code
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 14 Jun 2013 12:30:38 +0200 |
parents | 53d08f33d094 |
children | 82b8bfb47260 |
comparison
equal
deleted
inserted
replaced
6332:f5bb53106ae8 | 6333:b58a71a5720c |
---|---|
49 public boolean parse(ImportGauge gauge) throws IOException { | 49 public boolean parse(ImportGauge gauge) throws IOException { |
50 | 50 |
51 File file = gauge.getStaFile(); | 51 File file = gauge.getStaFile(); |
52 | 52 |
53 log.info("parsing STA file: " + file); | 53 log.info("parsing STA file: " + file); |
54 LineNumberReader in = null; | 54 LineNumberReader in = |
55 new LineNumberReader( | |
56 new InputStreamReader( | |
57 new FileInputStream(file), ENCODING)); | |
58 | |
55 try { | 59 try { |
56 in = | |
57 new LineNumberReader( | |
58 new InputStreamReader( | |
59 new FileInputStream(file), ENCODING)); | |
60 | |
61 String line = in.readLine(); | 60 String line = in.readLine(); |
62 | 61 |
63 if (line == null) { | 62 if (line == null) { |
64 log.warn("STA file is empty."); | 63 log.warn("STA file is empty."); |
65 return false; | 64 return false; |
186 new ArrayList<ImportMainValueType>(types.values())); | 185 new ArrayList<ImportMainValueType>(types.values())); |
187 gauge.setNamedMainValues(namedMainValues); | 186 gauge.setNamedMainValues(namedMainValues); |
188 gauge.setMainValues(mainValues); | 187 gauge.setMainValues(mainValues); |
189 } | 188 } |
190 finally { | 189 finally { |
191 if (in != null) { | 190 in.close(); |
192 in.close(); | |
193 } | |
194 } | 191 } |
195 log.info("finished parsing STA file: " + file); | 192 log.info("finished parsing STA file: " + file); |
196 return true; | 193 return true; |
197 } | 194 } |
198 | 195 |