comparison src/java/de/intevation/mxd/Converter.java @ 25:cbd67b1100d8

Initial commit of the first prototype.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 08 Apr 2011 11:47:59 +0200
parents c0060abb7457
children 0e71a1f71ec0
comparison
equal deleted inserted replaced
24:c0060abb7457 25:cbd67b1100d8
1 package de.intevation.mxd; 1 //package de.intevation.mxd;
2 2
3 import java.io.IOException;
4 import java.io.File;
5 import java.io.FileOutputStream;
6 import java.io.OutputStream;
7
8 import org.apache.log4j.Logger;
9 import org.apache.log4j.PropertyConfigurator;
10
11 import java.net.MalformedURLException;
3 12
4 /** 13 /**
5 * The entry point of the MXD converter tool. 14 * The entry point of the MXD converter tool.
6 * 15 *
7 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 16 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
8 */ 17 */
9 public class Converter { 18 public class Converter {
10 19
20 /**
21 * The logging is done via Log4j. To configure the logging
22 * a file 'log4j.properties' is search in the configuration
23 * directory.
24 */
25 public static final String LOG4J_PROPERTIES = "log4j.properties";
26
27 /**
28 *
29 * The path of the configuration directory.
30 */
31 public static final String CONFIG_PATH = System.getProperty("config.dir",
32 "conf");
33
34
35 /**
36 * The logger used in this class.
37 */
38 private static Logger logger;
39
40 static {
41 configureLogging();
42 logger = Logger.getLogger(Converter.class);
43 }
44
45
46 /**
47 * Trys to load the Log4j configuration
48 * from ${config.dir}/log4j.properties.
49 */
50 public static final void configureLogging() {
51 File configDir = new File(CONFIG_PATH);
52 File propFile = new File(configDir, LOG4J_PROPERTIES);
53 if (propFile.isFile() && propFile.canRead()) {
54 try {
55 PropertyConfigurator.configure(propFile.toURI().toURL());
56 }
57 catch (MalformedURLException mue) {
58 mue.printStackTrace(System.err);
59 }
60 }
61 }
62
63 /**
64 * Entrypoint for the application.
65 */
11 public static void main(String[] args) { 66 public static void main(String[] args) {
12 // TODO FILL ME 67 try{
68 IReader reader = new MXDReader();
69 reader.init();
70 // reader.setFilename("testdata/SubsurfaceSediments-Internet.mxd");
71 // reader.setFilename("testdata/p_single_4pt_c255-0-0.mxd");
72 // reader.setFilename("testdata/Facilities-Internet.mxd");
73 // reader.setFilename("testdata/fernerkundung_albedo.mxd");
74 reader.setFilename("testdata/gevu.mxd");
75
76 reader.read();
77 reader.shutdown();
78 }
79 catch(IOException e){
80 e.printStackTrace();
81 }
13 } 82 }
14 } 83 }
15 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 84 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)