public class JettyResponseListener
extends org.eclipse.jetty.client.util.InputStreamResponseListener
Response
input stream.Constructor and Description |
---|
JettyResponseListener(org.eclipse.jetty.client.api.Request request,
long queryTimeoutMillis) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Abort the request/response.
|
void |
abort(Throwable cause)
Abort the request/response.
|
String |
getContentEncoding()
Return the content encoding specified by the
charset MIME
parameter for the Content-Type header and null
if that MIME type parameter was not specified. |
String |
getContentType()
Return the value of the
Content-Type header. |
org.eclipse.jetty.http.HttpFields |
getHeaders()
The http headers.
|
InputStream |
getInputStream() |
String |
getReason()
The http reason line.
|
String |
getResponseBody()
Return the response body as a string.
|
int |
getStatus()
The http status code.
|
await, get, onComplete, onContent, onFailure, onHeaders, onSuccess
public JettyResponseListener(org.eclipse.jetty.client.api.Request request, long queryTimeoutMillis)
request
- queryTimeoutMillis
- the timeout in milliseconds (if non-positive, then an infinite
timeout is used).public String getContentType() throws IOException
Content-Type
header.IOException
public String getContentEncoding() throws IOException
charset
MIME
parameter for the Content-Type
header and null
if that MIME type parameter was not specified.
Note: Per Section 3.7.1 Canonicalization and Text Defaults of the HTTP 1.1 specification:
charset
parameter was
specified and otherwise null
.IOException
public int getStatus() throws IOException
IOException
public String getReason() throws IOException
IOException
public org.eclipse.jetty.http.HttpFields getHeaders() throws IOException
IOException
public String getResponseBody() throws IOException
IOException
public InputStream getInputStream()
getInputStream
in class org.eclipse.jetty.client.util.InputStreamResponseListener
public void abort()
InputStream
is closed.public void abort(Throwable cause)
InputStream
is closed.cause
- The cause (required).Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.