Apache Nutch is an extensible and scalable web crawler
add hint and log warning that fetcher.store.robotstxt works only in combination with fetcher.store.content
Sebastian Nagel33cdca76ac91
diff --git a/conf/nutch-default.xml b/conf/nutch-default.xmlindex 8c329bcdf..ec9d2d474 100644--- a/conf/nutch-default.xml+++ b/conf/nutch-default.xml@@ -985,8 +985,10 @@<property><name>fetcher.store.robotstxt</name><value>false</value>- <description>If true, fetcher will store the robots.txt response- content and status for debugging or archival purposes.+ <description>If true (and fetcher.store.content is also true),+ fetcher will store the robots.txt response content and status for+ debugging or archival purposes. The robots.txt is added to the+ content/ folder of the fetched segment.</description></property>diff --git a/src/java/org/apache/nutch/fetcher/FetcherThread.java b/src/java/org/apache/nutch/fetcher/FetcherThread.javaindex 6024b8dfe..449e2203e 100644--- a/src/java/org/apache/nutch/fetcher/FetcherThread.java+++ b/src/java/org/apache/nutch/fetcher/FetcherThread.java@@ -192,7 +192,11 @@ public class FetcherThread extends Thread {outlinksDepthDivisor = conf.getInt("fetcher.follow.outlinks.depth.divisor", 2);if (conf.getBoolean("fetcher.store.robotstxt", false)) {- robotsTxtContent = new LinkedList<Content>();+ if (storingContent) {+ robotsTxtContent = new LinkedList<Content>();+ } else {+ LOG.warn("Ignoring fetcher.store.robotstxt because not storing content (fetcher.store.content)!");+ }}}