Package org.apache.hc.client5.http.impl
Class DefaultRedirectStrategy
- java.lang.Object
-
- org.apache.hc.client5.http.impl.DefaultRedirectStrategy
-
- All Implemented Interfaces:
RedirectStrategy
@Contract(threading=STATELESS) public class DefaultRedirectStrategy extends java.lang.Object implements RedirectStrategy
Default implementation ofRedirectStrategy.- Since:
- 4.1
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultRedirectStrategyINSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultRedirectStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.net.URIcreateLocationURI(java.lang.String location)java.net.URIgetLocationURI(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context)booleanisRedirected(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context)Determines if a request should be redirected to a new location given the response from the target server.
-
-
-
Field Detail
-
INSTANCE
public static final DefaultRedirectStrategy INSTANCE
-
-
Method Detail
-
isRedirected
public boolean isRedirected(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.ProtocolExceptionDescription copied from interface:RedirectStrategyDetermines if a request should be redirected to a new location given the response from the target server.- Specified by:
isRedirectedin interfaceRedirectStrategy- Parameters:
request- the executed requestresponse- the response received from the target servercontext- the context for the request execution- Returns:
trueif the request should be redirected,falseotherwise- Throws:
org.apache.hc.core5.http.ProtocolException
-
getLocationURI
public java.net.URI getLocationURI(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException- Specified by:
getLocationURIin interfaceRedirectStrategy- Throws:
org.apache.hc.core5.http.HttpException
-
createLocationURI
protected java.net.URI createLocationURI(java.lang.String location) throws org.apache.hc.core5.http.ProtocolException- Throws:
org.apache.hc.core5.http.ProtocolException- Since:
- 4.1
-
-