Apache Nutch is an extensible and scalable web crawler
NUTCH-1629 Injector skips empty lines
Julien Niochea2ae871f8e60
diff --git a/CHANGES.txt b/CHANGES.txtindex 130a0d76c..0b05067ea 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -2,6 +2,8 @@ Nutch Change LogNutch Development Trunk+* NUTCH-1629 Injector skips empty lines in seed files (kaveh minooie via jnioche)+* NUTCH-911 protocol-file to return proper protocol status (Peter Lundberg via snagel)* NUTCH-806 Merge CrawlDBScanner with CrawlDBReader (jnioche)diff --git a/src/java/org/apache/nutch/crawl/Injector.java b/src/java/org/apache/nutch/crawl/Injector.javaindex 2cf1020c1..0b1ccf5a3 100644--- a/src/java/org/apache/nutch/crawl/Injector.java+++ b/src/java/org/apache/nutch/crawl/Injector.java@@ -84,9 +84,9 @@ public class Injector extends Configured implements Tool {public void map(WritableComparable<?> key, Text value,OutputCollector<Text, CrawlDatum> output, Reporter reporter)throws IOException {- String url = value.toString(); // value is line of text+ String url = value.toString().trim(); // value is line of text- if (url != null && url.trim().startsWith("#")) {+ if (url != null && ( url.length() == 0 || url.startsWith("#") ) ) {/* Ignore line that start with # */return;}