Class JDKHttpResponseWrapper
java.lang.Object
is.galia.http.JDKHttpResponseWrapper
- All Implemented Interfaces:
Response
,Closeable
,AutoCloseable
Adapts a
HttpResponse
to comply with Response
.-
Constructor Details
-
JDKHttpResponseWrapper
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getBody
- Specified by:
getBody
in interfaceResponse
- Throws:
IOException
-
getBodyAsStream
- Specified by:
getBodyAsStream
in interfaceResponse
- Returns:
- A
ByteArrayInputStream
around the return value ofResponse.getBody()
. Implementations should override if they can be more efficient.
-
getBodyAsString
- Specified by:
getBodyAsString
in interfaceResponse
- Returns:
- New UTF-8 string based on the return value of
Response.getBody()
. - Throws:
IOException
-
getHeaders
- Specified by:
getHeaders
in interfaceResponse
-
getStatus
-
getTransport
- Specified by:
getTransport
in interfaceResponse
-