[Dive4elements-commits] [PATCH 2 of 5] AtFileParser, README: Added main-method for AT-File-Parsing debugging, doc

Wald Commits scm-commit at wald.intevation.org
Tue Mar 19 10:18:24 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1363621781 -3600
# Node ID 95af0f3aabfb6bd3f161dd64434afa37304383c3
# Parent  4ccf1175be1cb19c7910b95c7df7636181eef700
AtFileParser, README: Added main-method for AT-File-Parsing debugging, doc.

diff -r 4ccf1175be1c -r 95af0f3aabfb flys-backend/README
--- a/flys-backend/README	Mon Mar 18 16:49:04 2013 +0100
+++ b/flys-backend/README	Mon Mar 18 16:49:41 2013 +0100
@@ -21,3 +21,5 @@
 110803
 EOF
 
+Some importer allow standalone usage:
+mvn -e -Dexec.mainClass=de.intevation.flys.importer.parsers.AtFileParser -Dexec.args=/home/felix/.bashrc exec:java
diff -r 4ccf1175be1c -r 95af0f3aabfb flys-backend/src/main/java/de/intevation/flys/importer/parsers/AtFileParser.java
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/AtFileParser.java	Mon Mar 18 16:49:04 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/AtFileParser.java	Mon Mar 18 16:49:41 2013 +0100
@@ -203,5 +203,20 @@
         cal.setTimeInMillis(ms - ms%1000);
         return cal.getTime();
     }
+
+
+    /** Parse one or more files, (useful for debugging), */
+    public static void main(String [] args) {
+
+        AtFileParser parser = new AtFileParser();
+
+        try {
+            for (String arg: args) {
+                parser.parse(new File(arg));
+            }
+        } catch(Exception e) {
+            logger.error("Exception caught " + e);
+        }
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list