Class HttpCacheSupport
java.lang.Object
org.apache.hc.client5.http.impl.cache.HttpCacheSupport
HTTP cache support utilities.
- Since:
- 5.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getRequestUri
(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpHost target) Returns text representation of the request URI of the givenHttpRequest
.static URI
Returns normalized representation of the request URI optimized for use as a cache key.static URI
normalizeQuetly
(String requestUri) Deprecated.static URI
normalizeQuietly
(String requestUri) Lenient URI parser that normalizes validURI
s and returnsnull
for malformed URIs.
-
Field Details
-
BASE_URI
-
-
Constructor Details
-
HttpCacheSupport
public HttpCacheSupport()
-
-
Method Details
-
getRequestUri
public static String getRequestUri(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpHost target) Returns text representation of the request URI of the givenHttpRequest
. This method will useHttpRequest.getPath()
,HttpRequest.getScheme()
andHttpRequest.getAuthority()
values when available or attributes of targetHttpHost
in order to construct an absolute URI.This method will not attempt to ensure validity of the resultant text representation.
- Parameters:
request
- theHttpRequest
target
- target host- Returns:
- String the request URI
-
normalize
Returns normalized representation of the request URI optimized for use as a cache key. This method ensures the resultant URI has an explicit port in the authority component, and explicit path component and no fragment.- Parameters:
requestUri
- original request URI- Returns:
- normalized URI.
- Throws:
URISyntaxException
-
normalizeQuetly
Deprecated.Lenient URI parser that normalizes validURI
s and returnsnull
for malformed URIs. -
normalizeQuietly
Lenient URI parser that normalizes validURI
s and returnsnull
for malformed URIs.- Since:
- 5.2
-
normalizeQuietly(String)