Package org.geotools.http
Interface HTTPResponse
- All Known Implementing Classes:
DefaultHttpResponse
,DelegateHTTPResponse
public interface HTTPResponse
Interface by which an
AbstractOpenWebService
retrieves the contents of an HTTP request issued through its
HTTPClient
.
An HTTPResponse instance shall be disposed
as soon as it's response
stream
has been consumed or is no longer needed. It's up to the implementations to just close the actual
InputStream
or return the http connection to the connection pool, or any other resource clean up task that
needs to be done.
- Author:
- groldan
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes this HTTP response and cleans up any resource being held.Short cut forgetResponseHeader("Content-Type")
getResponseHeader
(String headerName) Returns the value of the requested HTTP response header, ornull
if not set.Returns the HTTP response content byte stream, automatically recognizing gzip encoded responses and returning an uncompressing stream if that's the case.
-
Method Details
-
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
Returns the value of the requested HTTP response header, ornull
if not set. -
getResponseStream
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
null
otherwise.
-