Package org.geotools.http
Interface HTTPResponse
-
- All Known Implementing Classes:
DefaultHttpResponse
,DelegateHTTPResponse
public interface HTTPResponse
Interface by which anAbstractOpenWebService
retrieves the contents of an HTTP request issued through itsHTTPClient
.An HTTPResponse instance shall be
disposed
as soon as it'sresponse stream
has been consumed or is no longer needed. It's up to the implementations to just close the actualInputStream
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:
HTTPClient
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dispose()
Disposes this HTTP response and cleans up any resource being held.String
getContentType()
Short cut forgetResponseHeader("Content-Type")
String
getResponseCharset()
String
getResponseHeader(String headerName)
Returns the value of the requested HTTP response header, ornull
if not set.InputStream
getResponseStream()
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, ornull
if 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
null
otherwise.
-
-