BufferedReader br = null;
String path = params.optString("path");
boolean forceRevisit = !params.isNull("forceRevisit");
boolean asSeeds = !params.isNull("asSeeds");
boolean scopeScheduleds = !params.isNull("scopeScheduleds");
DecideRule scope = scopeScheduleds ? getScope() : null;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(path)));
Iterator<String> iter = new RegexLineIterator(new LineReadingIterator(br),
RegexLineIterator.COMMENT_LINE, extractor, output);
while(iter.hasNext()) {
try {
CrawlURI curi = CrawlURI.fromHopsViaString(((String)iter.next()));
curi.setForceFetch(forceRevisit);
if (asSeeds) {
curi.setSeed(asSeeds);
if (curi.getVia() == null || curi.getVia().length() <= 0) {
// Danger of double-add of seeds because of this code here.
// Only call addSeed if no via. If a via, the schedule will
// take care of updating scope.
getSeeds().addSeed(curi);
}
}
if(scope!=null) {
//TODO:SPRINGY
// curi.setStateProvider(controller.getSheetManager());
if(!scope.accepts(curi)) {
continue;
}
}
this.controller.getFrontier().schedule(curi);