public final class JavaApiConverter extends Object
| Modifier and Type | Method and Description |
|---|---|
static CacheRequest |
createJavaCacheRequest(CacheRequest okCacheRequest) |
static CacheResponse |
createJavaCacheResponse(Response response)
Creates a
CacheResponse of the correct (sub)type using information gathered
from the supplied Response. |
static Request |
createOkRequest(URI uri,
String requestMethod,
Map<String,List<String>> requestHeaders)
Creates an OkHttp
Request from the supplied information. |
static Response |
createOkResponseForCachePut(URI uri,
URLConnection urlConnection)
|
public static Response createOkResponseForCachePut(URI uri, URLConnection urlConnection) throws IOException
Response using the supplied URI and URLConnection to
supply the data. The URLConnection is assumed to already be connected. If this method returns
null the response is uncacheable.IOExceptionpublic static Request createOkRequest(URI uri, String requestMethod, Map<String,List<String>> requestHeaders)
Request from the supplied information.
This method allows a null value for requestHeaders for situations where a
connection is already connected and access to the headers has been lost. See URLConnection.getRequestProperties() for details.
public static CacheResponse createJavaCacheResponse(Response response)
CacheResponse of the correct (sub)type using information gathered
from the supplied Response.public static CacheRequest createJavaCacheRequest(CacheRequest okCacheRequest)
Copyright © 2017. All Rights Reserved.