Class HttpCacheSupport
- java.lang.Object
-
- org.apache.hc.client5.http.impl.cache.HttpCacheSupport
-
public final class HttpCacheSupport extends java.lang.ObjectHTTP cache support utilities.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private static java.net.URIBASE_URI
-
Constructor Summary
Constructors Constructor Description HttpCacheSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.StringgetRequestUri(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 java.net.URInormalize(java.net.URI requestUri)Returns normalized representation of the request URI optimized for use as a cache key.static java.net.URInormalizeQuetly(java.lang.String requestUri)Deprecated.static java.net.URInormalizeQuietly(java.lang.String requestUri)Lenient URI parser that normalizes validURIs and returnsnullfor malformed URIs.
-
-
-
Method Detail
-
getRequestUri
public static java.lang.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 targetHttpHostin order to construct an absolute URI.This method will not attempt to ensure validity of the resultant text representation.
- Parameters:
request- theHttpRequesttarget- target host- Returns:
- String the request URI
-
normalize
public static java.net.URI normalize(java.net.URI requestUri) throws java.net.URISyntaxExceptionReturns 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:
java.net.URISyntaxException
-
normalizeQuetly
@Deprecated public static java.net.URI normalizeQuetly(java.lang.String requestUri)
Deprecated.Lenient URI parser that normalizes validURIs and returnsnullfor malformed URIs.
-
normalizeQuietly
public static java.net.URI normalizeQuietly(java.lang.String requestUri)
Lenient URI parser that normalizes validURIs and returnsnullfor malformed URIs.- Since:
- 5.2
-
-