public class RedirectStrategyWrapper extends Object implements org.apache.http.client.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(org.apache.http.client.RedirectStrategy nested,
IRedirectURLProvider redirectURLProvider) |
Modifier and Type | Method and Description |
---|---|
org.apache.http.client.RedirectStrategy |
getOriginalRedirectStrategy() |
org.apache.http.client.methods.HttpUriRequest |
getRedirect(org.apache.http.HttpRequest request,
org.apache.http.HttpResponse response,
org.apache.http.protocol.HttpContext context) |
static String |
getRedirectURL() |
IRedirectURLProvider |
getRedirectURLProvider()
Gets the redirect URL provider.
|
boolean |
isRedirected(org.apache.http.HttpRequest request,
org.apache.http.HttpResponse response,
org.apache.http.protocol.HttpContext context) |
static void |
setRedirectURL(String redirectUrl)
Sets the redirect URL.
|
public RedirectStrategyWrapper(org.apache.http.client.RedirectStrategy nested, IRedirectURLProvider redirectURLProvider)
public static String getRedirectURL()
public static void setRedirectURL(String redirectUrl)
redirectUrl
- redirect URLpublic IRedirectURLProvider getRedirectURLProvider()
public boolean isRedirected(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context) throws org.apache.http.ProtocolException
isRedirected
in interface org.apache.http.client.RedirectStrategy
org.apache.http.ProtocolException
public org.apache.http.client.methods.HttpUriRequest getRedirect(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context) throws org.apache.http.ProtocolException
getRedirect
in interface org.apache.http.client.RedirectStrategy
org.apache.http.ProtocolException
public org.apache.http.client.RedirectStrategy getOriginalRedirectStrategy()
Copyright © 2009–2021 Norconex Inc.. All rights reserved.