comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/BedHeightSingleParser.java @ 2806:33f40b23edd8

Initial checkin for parsing MINFO bed heights. flys-backend/trunk@4211 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 11 Apr 2012 09:30:04 +0000
parents
children b57c95094b68
comparison
equal deleted inserted replaced
2805:a55b7b35cc3a 2806:33f40b23edd8
1 package de.intevation.flys.importer.parsers;
2
3 import java.io.File;
4
5 import java.util.List;
6 import java.util.ArrayList;
7
8 import java.io.IOException;
9 import java.io.LineNumberReader;
10 import java.io.FileInputStream;
11 import java.io.InputStreamReader;
12
13 import org.apache.log4j.Logger;
14
15 import de.intevation.flys.importer.ImportBedHeightSingle;
16
17
18 public class BedHeightSingleParser {
19
20 public static final String ENCODING = "ISO-8859-1";
21
22
23 private static final Logger log =
24 Logger.getLogger(BedHeightSingleParser.class);
25
26
27 protected List<ImportBedHeightSingle> bedHeights;
28
29
30 public BedHeightSingleParser() {
31 bedHeights = new ArrayList<ImportBedHeightSingle>();
32 }
33
34
35 public List<ImportBedHeightSingle> getBedHeights() {
36 return bedHeights;
37 }
38
39
40 public void parse(File file) throws IOException {
41 log.info("Parsing bed height single file '" + file + "'");
42
43 LineNumberReader in = null;
44 try {
45 in =
46 new LineNumberReader(
47 new InputStreamReader(
48 new FileInputStream(file), ENCODING));
49
50 String line = null;
51 while ((line = in.readLine()) != null) {
52 if ((line = line.trim()).length() == 0) {
53 continue;
54 }
55 }
56 }
57 finally {
58 if (in != null) {
59 in.close();
60 }
61 }
62 }
63 }
64 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org