Package org.geotools.http
Interface HTTPResponse
-
- All Known Implementing Classes:
DefaultHttpResponse,DelegateHTTPResponse
public interface HTTPResponseInterface by which anAbstractOpenWebServiceretrieves the contents of an HTTP request issued through itsHTTPClient.An HTTPResponse instance shall be
disposedas soon as it'sresponse streamhas been consumed or is no longer needed. It's up to the implementations to just close the actualInputStreamor return the http connection to the connection pool, or any other resource clean up task that needs to be done.- Author:
- groldan
- See Also:
HTTPClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose()Disposes this HTTP response and cleans up any resource being held.StringgetContentType()Short cut forgetResponseHeader("Content-Type")StringgetResponseCharset()StringgetResponseHeader(String headerName)Returns the value of the requested HTTP response header, ornullif not set.InputStreamgetResponseStream()Returns the HTTP response content byte stream, automatically recognizing gzip encoded responses and returning an uncompressing stream if that's the case.
-
-
-
Method Detail
-
dispose
void dispose()
Disposes this HTTP response and cleans up any resource being held.Multiple invocations of this method shall not raise an exception but return silently.
-
getContentType
String getContentType()
Short cut forgetResponseHeader("Content-Type")
-
getResponseHeader
String getResponseHeader(String headerName)
Returns the value of the requested HTTP response header, ornullif not set.
-
getResponseStream
InputStream getResponseStream() throws IOException
Returns the HTTP response content byte stream, automatically recognizing gzip encoded responses and returning an uncompressing stream if that's the case.- Throws:
IOException- if such happens when obtaining the response stream.
-
getResponseCharset
String getResponseCharset()
- Returns:
- the response charset parsed out of the content type response header, if any, or
nullotherwise.
-
-