org.apache.http.impl.client
Class DefaultRedirectStrategy
java.lang.Object
org.apache.http.impl.client.DefaultRedirectStrategy
- All Implemented Interfaces:
- RedirectStrategy
@Immutable
public class DefaultRedirectStrategy
- extends Object
- implements RedirectStrategy
Default implementation of RedirectStrategy
.
- Since:
- 4.1
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REDIRECT_LOCATIONS
public static final String REDIRECT_LOCATIONS
- See Also:
- Constant Field Values
DefaultRedirectStrategy
public DefaultRedirectStrategy()
isRedirected
public boolean isRedirected(HttpRequest request,
HttpResponse response,
HttpContext context)
throws ProtocolException
- Description copied from interface:
RedirectStrategy
- Determines if a request should be redirected to a new location
given the response from the target server.
- Specified by:
isRedirected
in interface RedirectStrategy
- Parameters:
request
- the executed requestresponse
- the response received from the target servercontext
- the context for the request execution
- Returns:
true
if the request should be redirected, false
otherwise
- Throws:
ProtocolException
getLocationURI
public URI getLocationURI(HttpRequest request,
HttpResponse response,
HttpContext context)
throws ProtocolException
- Throws:
ProtocolException
createLocationURI
protected URI createLocationURI(String location)
throws ProtocolException
- Throws:
ProtocolException
- Since:
- 4.1
getRedirect
public HttpUriRequest getRedirect(HttpRequest request,
HttpResponse response,
HttpContext context)
throws ProtocolException
- Description copied from interface:
RedirectStrategy
- Determines the redirect location given the response from the target
server and the current request execution context and generates a new
request to be sent to the location.
- Specified by:
getRedirect
in interface RedirectStrategy
- Parameters:
request
- the executed requestresponse
- the response received from the target servercontext
- the context for the request execution
- Returns:
- redirected request
- Throws:
ProtocolException
Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.