try to guess default crawling mode, if none set

This commit is contained in:
bhoerdzn 2013-10-07 13:13:22 +02:00
parent b4f0c822f2
commit 45cf553bc3

View File

@ -99,10 +99,22 @@ public class CrawlStartExpert_p {
// sitemap needs "crawlingFile" parameter, checked already
prop.put("crawlingMode_file", "1");
hasMode = true;
}
// default to URL mode
if (!hasMode) {
} else if (crawlingMode.equalsIgnoreCase("url")
&& prop.getBoolean("has_crawlingURL")) {
prop.put("crawlingMode_url", "1");
hasMode = true;
}
// try to guess mode
if (!hasMode) {
if (prop.getBoolean("has_crawlingURL")) {
prop.put("crawlingMode_url", "1");
} else if (prop.getBoolean("has_sitemapURL")) {
prop.put("crawlingMode_sitemap", "1");
} else if (prop.getBoolean("has_crawlingFile")) {
prop.put("crawlingMode_file", "1");
} else {
prop.put("crawlingMode_url", "1");
}
}
} else {
// default to URL