public class ApacheRedirectCaptureStrategy
extends org.apache.http.impl.client.LaxRedirectStrategy
This class is used by each crawler instance to capture the closest redirect target whether it is part of a redirect chain or not. Target URLs are treated as new URLs to potentially process, while the original URL gets rejected.
Modifier and Type | Field and Description |
---|---|
static String |
TARGET_REDIRECT_CONTEXT_KEY |
Constructor and Description |
---|
ApacheRedirectCaptureStrategy(IRedirectURLProvider redirectURLProvider) |
Modifier and Type | Method and Description |
---|---|
static String |
getRedirectTarget(org.apache.http.protocol.HttpContext context) |
boolean |
isRedirected(org.apache.http.HttpRequest request,
org.apache.http.HttpResponse response,
org.apache.http.protocol.HttpContext context) |
public static final String TARGET_REDIRECT_CONTEXT_KEY
public ApacheRedirectCaptureStrategy(IRedirectURLProvider redirectURLProvider)
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
isRedirected
in class org.apache.http.impl.client.DefaultRedirectStrategy
org.apache.http.ProtocolException
public static String getRedirectTarget(org.apache.http.protocol.HttpContext context)
Copyright © 2009–2023 Norconex Inc.. All rights reserved.