public class RedirectStrategyWrapper extends Object implements RedirectStrategy
This class is used by each crawler instance to wrap the original redirect
strategy set on the HttpClient to make sure redirect
target URLs are handled as required.
Target URLs are treated as new URLs to potentially process,
while the original URL gets rejected.
| Constructor and Description |
|---|
RedirectStrategyWrapper(RedirectStrategy nested,
IRedirectURLProvider redirectURLProvider) |
| Modifier and Type | Method and Description |
|---|---|
RedirectStrategy |
getOriginalRedirectStrategy() |
HttpUriRequest |
getRedirect(HttpRequest request,
HttpResponse response,
HttpContext context) |
static String |
getRedirectURL() |
IRedirectURLProvider |
getRedirectURLProvider()
Gets the redirect URL provider.
|
boolean |
isRedirected(HttpRequest request,
HttpResponse response,
HttpContext context) |
static void |
setRedirectURL(String redirectUrl)
Sets the redirect URL.
|
public RedirectStrategyWrapper(RedirectStrategy nested, IRedirectURLProvider redirectURLProvider)
public static String getRedirectURL()
public static void setRedirectURL(String redirectUrl)
redirectUrl - redirect URLpublic IRedirectURLProvider getRedirectURLProvider()
public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context) throws ProtocolException
isRedirected in interface RedirectStrategyProtocolExceptionpublic HttpUriRequest getRedirect(HttpRequest request, HttpResponse response, HttpContext context) throws ProtocolException
getRedirect in interface RedirectStrategyProtocolExceptionpublic RedirectStrategy getOriginalRedirectStrategy()
Copyright © 2009–2020 Norconex Inc.. All rights reserved.