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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getBody
- Specified by:
getBodyin interfaceResponse- Throws:
IOException
-
getBodyAsStream
- Specified by:
getBodyAsStreamin interfaceResponse- Returns:
- A
ByteArrayInputStreamaround the return value ofResponse.getBody(). Implementations should override if they can be more efficient.
-
getBodyAsString
- Specified by:
getBodyAsStringin interfaceResponse- Returns:
- New UTF-8 string based on the return value of
Response.getBody(). - Throws:
IOException
-
getHeaders
- Specified by:
getHeadersin interfaceResponse
-
getStatus
-
getTransport
- Specified by:
getTransportin interfaceResponse
-