comparison flys-aft/src/main/java/de/intevation/aft/Sync.java @ 4072:88f801888d85

load configuration an setup db connections. flys-aft/trunk@3401 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 13 Dec 2011 12:33:36 +0000
parents d5aed044ca0d
children 2c70fae83d0c
comparison
equal deleted inserted replaced
4071:0f5cc88a0f74 4072:88f801888d85
1 package de.intevation.aft; 1 package de.intevation.aft;
2
3 import java.io.File;
4
5 import org.w3c.dom.Document;
6
7 import de.intevation.utils.XML;
8
9 import de.intevation.db.ConnectionBuilder;
2 10
3 public class Sync 11 public class Sync
4 { 12 {
13 public static final String FLYS = "flys";
14 public static final String AFT = "aft";
15
16 public static final String CONFIG_FILE =
17 System.getProperty("config.file", "config.xml");
18
5 public static void main(String [] args) { 19 public static void main(String [] args) {
20
21 File configFile = new File(CONFIG_FILE);
22
23 if (!configFile.isFile() || !configFile.canRead()) {
24 System.err.println("cannot read config file");
25 System.exit(1);
26 }
27
28 Document config = XML.parseDocument(configFile, Boolean.FALSE);
29
30 if (config == null) {
31 System.err.println("cannot load config");
32 System.exit(1);
33 }
34
35 ConnectionBuilder flysConnectionBuilder =
36 new ConnectionBuilder(FLYS, config);
37
38 ConnectionBuilder aftConnectionBuilder =
39 new ConnectionBuilder(AFT, config);
40
6 } 41 }
7 } 42 }
8 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 43 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org