}
}
private CrawljaxConfiguration readConfig(String urlValue, String outputDir) {
CrawljaxConfigurationBuilder builder = CrawljaxConfiguration.builderFor(urlValue);
BrowserType browser = BrowserType.firefox;
if (options.specifiesBrowser()) {
browser = options.getSpecifiedBrowser();
}
int browsers = 1;
if (options.specifiesParallelBrowsers()) {
browsers = options.getSpecifiedNumberOfBrowsers();
}
builder.setBrowserConfig(new BrowserConfiguration(browser, browsers));
if (options.specifiesDepth()) {
builder.setMaximumDepth(options.getSpecifiedDepth());
}
if (options.specifiesMaxStates()) {
builder.setMaximumStates(options.getMaxStates());
}
if (options.requestsCrawlHiddenAnchors()) {
builder.crawlRules().crawlHiddenAnchors(true);
}
configureTimers(builder);
builder.addPlugin(new CrawlOverview(new File(outputDir)));
if (options.specifiesClickElements()) {
builder.crawlRules().click(options.getSpecifiedClickElements());
} else {
builder.crawlRules().clickDefaultElements();
}
return builder.build();
}