Mercurial > dive4elements > river
changeset 5331:95af0f3aabfb
AtFileParser, README: Added main-method for AT-File-Parsing debugging, doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 18 Mar 2013 16:49:41 +0100 |
parents | 4ccf1175be1c |
children | 26979cf5a31c |
files | flys-backend/README flys-backend/src/main/java/de/intevation/flys/importer/parsers/AtFileParser.java |
diffstat | 2 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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 :