use of org.codelibs.fess.crawler.entity.Sitemap in project fess-crawler by codelibs.
the class SitemapsResponseProcessor method process.
@Override
public void process(final ResponseData responseData) {
final SitemapsHelper sitemapsHelper = crawlerContainer.getComponent("sitemapsHelper");
try (final InputStream responseBody = responseData.getResponseBody()) {
final SitemapSet sitemapSet = sitemapsHelper.parse(responseBody);
final Set<RequestData> requestDataSet = new LinkedHashSet<>();
for (final Sitemap sitemap : sitemapSet.getSitemaps()) {
if (sitemap != null) {
requestDataSet.add(RequestDataBuilder.newRequestData().get().url(sitemap.getLoc()).build());
}
}
throw new ChildUrlsException(requestDataSet, this.getClass().getName() + "#process");
} catch (final IOException e) {
throw new IORuntimeException(e);
}
}
Aggregations