private void handleRequestRedirect ( final CrawlCandidate currentCrawlCandidate , final String redirectedUrl ) { CrawlRequestBuilder builder = new CrawlRequestBuilder ( redirectedUrl ) . setPriority ( currentCrawlCandidate . getPriority ( ) ) ; currentCrawlCandidate . getMetadata ( ) . ifPresent ( builder :: setMetadata ) ; CrawlRequest redirectedRequest = builder . build ( ) ; crawlFrontier . feedRequest ( redirectedRequest , false ) ; callbackManager . call ( CrawlEvent . REQUEST_REDIRECT , new RequestRedirectEvent ( currentCrawlCandidate , redirectedRequest ) ) ; }
Creates a crawl request for the redirected URL feeds it to the crawler and calls the appropriate event callback .