changeset 4721:b0b1008c07e9

LineParser: Make file name available to subclasses.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 27 Dec 2012 13:19:34 +0100
parents 9f7cd65daac2
children c3e2b0d343dc
files flys-backend/src/main/java/de/intevation/flys/importer/parsers/LineParser.java
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/LineParser.java	Thu Dec 27 13:13:24 2012 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/LineParser.java	Thu Dec 27 13:19:34 2012 +0100
@@ -42,6 +42,9 @@
 
     protected abstract void finish();
 
+    /** Name of file parsed. */
+    protected String fileName;
+
 
     /**
      * This method reads each line of <i>file</i>. At the beginning,
@@ -53,6 +56,8 @@
     public void parse(File file) throws IOException {
         log.info("Parsing file '" + file + "'");
 
+        fileName = file.getName();
+
         reset();
 
         LineNumberReader in = null;
@@ -83,6 +88,12 @@
     }
 
 
+    /** Returns the name of the file parsed. */
+    protected String getFileName() {
+        return fileName;
+    }
+
+
     protected static String stripMetaLine(String line) {
         String tmp = line.substring(1, line.length());
 

http://dive4elements.wald.intevation.org