public final class JavaApiConverter extends Object
| Modifier and Type | Method and Description |
|---|---|
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 |
createOkResponse(URI uri,
URLConnection urlConnection)
|
public static Response createOkResponse(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.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.Copyright © 2014. All Rights Reserved.