Mercurial > mxd2map
view src/java/de/intevation/mxd/Converter.java @ 26:3e24fffdf2bb
Moved reader components to reader folder.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 08 Apr 2011 12:26:17 +0200 |
parents | cbd67b1100d8 |
children | 0e71a1f71ec0 |
line wrap: on
line source
//package de.intevation.mxd; import java.io.IOException; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import java.net.MalformedURLException; /** * The entry point of the MXD converter tool. * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class Converter { /** * The logging is done via Log4j. To configure the logging * a file 'log4j.properties' is search in the configuration * directory. */ public static final String LOG4J_PROPERTIES = "log4j.properties"; /** * * The path of the configuration directory. */ public static final String CONFIG_PATH = System.getProperty("config.dir", "conf"); /** * The logger used in this class. */ private static Logger logger; static { configureLogging(); logger = Logger.getLogger(Converter.class); } /** * Trys to load the Log4j configuration * from ${config.dir}/log4j.properties. */ public static final void configureLogging() { File configDir = new File(CONFIG_PATH); File propFile = new File(configDir, LOG4J_PROPERTIES); if (propFile.isFile() && propFile.canRead()) { try { PropertyConfigurator.configure(propFile.toURI().toURL()); } catch (MalformedURLException mue) { mue.printStackTrace(System.err); } } } /** * Entrypoint for the application. */ public static void main(String[] args) { try{ IReader reader = new MXDReader(); reader.init(); // reader.setFilename("testdata/SubsurfaceSediments-Internet.mxd"); // reader.setFilename("testdata/p_single_4pt_c255-0-0.mxd"); // reader.setFilename("testdata/Facilities-Internet.mxd"); // reader.setFilename("testdata/fernerkundung_albedo.mxd"); reader.setFilename("testdata/gevu.mxd"); reader.read(); reader.shutdown(); } catch(IOException e){ e.printStackTrace(); } } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :