[Dive4elements-commits] [PATCH 05 of 11] LineParser: Make file name available to subclasses
Wald Commits
scm-commit at wald.intevation.org
Thu Dec 27 16:10:31 CET 2012
# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1356610774 -3600
# Node ID b0b1008c07e926b971465c7871a73de2771defde
# Parent 9f7cd65daac21a263692e61ff2ea145726bc8501
LineParser: Make file name available to subclasses.
diff -r 9f7cd65daac2 -r b0b1008c07e9 flys-backend/src/main/java/de/intevation/flys/importer/parsers/LineParser.java
--- 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());
More information about the Dive4elements-commits
mailing list