Top Fields Constructors Methods
org.eclipse.jetty.client.internal

public Class HttpContentResponse

extends Object
implements ContentResponse
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.client.ContentResponse, org.eclipse.jetty.client.Response
Imports
java.io.UnsupportedEncodingException, java.nio.charset.StandardCharsets, .UnsupportedCharsetException, java.util.concurrent.CompletableFuture, org.eclipse.jetty.client.ContentResponse, .Request, .Response, org.eclipse.jetty.http.HttpFields, .HttpVersion

Field Summary

Modifier and TypeField and Description
private final byte[]
private final String
private final String
private final Response

Constructor Summary

AccessConstructor and Description
public
HttpContentResponse(Response response, byte[] content, String mediaType, String encoding)

Method Summary

Modifier and TypeMethod and Description
public CompletableFuture<Boolean>
abort(Throwable
the abort cause, must not be null
cause
)

Implements org.eclipse.jetty.client.Response.abort.

Attempts to abort the receive of this response.

public byte[]
public String
public String
public HttpFields
getHeaders()

Implements org.eclipse.jetty.client.Response.getHeaders.

Returns the headers of this response.

public String
public String
public Request
public int
public HttpFields
public HttpVersion
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

contentback to summary
private final byte[] content
encodingback to summary
private final String encoding
mediaTypeback to summary
private final String mediaType
responseback to summary
private final Response response

Constructor Detail

HttpContentResponseback to summary
public HttpContentResponse(Response response, byte[] content, String mediaType, String encoding)

Method Detail

abortback to summary
public CompletableFuture<Boolean> abort(Throwable cause)

Implements org.eclipse.jetty.client.Response.abort.

Doc from org.eclipse.jetty.client.Response.abort.

Attempts to abort the receive of this response.

Parameters
cause:Throwable

the abort cause, must not be null

Returns:CompletableFuture<Boolean>

whether the abort succeeded

Annotations
@Override
getContentback to summary
public byte[] getContent()

Implements org.eclipse.jetty.client.ContentResponse.getContent.

Returns:byte[]

Doc from org.eclipse.jetty.client.ContentResponse.getContent.

the response content

Annotations
@Override
getContentAsStringback to summary
public String getContentAsString()

Implements org.eclipse.jetty.client.ContentResponse.getContentAsString.

Returns:String

Doc from org.eclipse.jetty.client.ContentResponse.getContentAsString.

the response content as a string, decoding the bytes using the charset provided by the Content-Type header, if any, or UTF-8.

Annotations
@Override
getEncodingback to summary
public String getEncoding()

Implements org.eclipse.jetty.client.ContentResponse.getEncoding.

Returns:String

Doc from org.eclipse.jetty.client.ContentResponse.getEncoding.

the encoding of the content, such as "UTF-8"

Annotations
@Override
getHeadersback to summary
public HttpFields getHeaders()

Implements org.eclipse.jetty.client.Response.getHeaders.

Doc from org.eclipse.jetty.client.Response.getHeaders.

Returns the headers of this response.

Some headers sent by the server may not be present, or be present but modified, while the content is being processed. A typical example is the Content-Length header when the content is sent compressed by the server and automatically decompressed by the client: the Content-Length header will be removed.

Similarly, the Content-Encoding header may be removed or modified, as the content is decoded by the client.

Returns:HttpFields

the headers of this response

Annotations
@Override
getMediaTypeback to summary
public String getMediaType()

Implements org.eclipse.jetty.client.ContentResponse.getMediaType.

Returns:String

Doc from org.eclipse.jetty.client.ContentResponse.getMediaType.

the media type of the content, such as "text/html" or "application/octet-stream"

Annotations
@Override
getReasonback to summary
public String getReason()

Implements org.eclipse.jetty.client.Response.getReason.

Returns:String

Doc from org.eclipse.jetty.client.Response.getReason.

the HTTP reason associated to the getStatus

Annotations
@Override
getRequestback to summary
public Request getRequest()

Implements org.eclipse.jetty.client.Response.getRequest.

Returns:Request

Doc from org.eclipse.jetty.client.Response.getRequest.

the request associated with this response

Annotations
@Override
getStatusback to summary
public int getStatus()

Implements org.eclipse.jetty.client.Response.getStatus.

Returns:int

Doc from org.eclipse.jetty.client.Response.getStatus.

the HTTP status code of this response, such as 200 or 404

Annotations
@Override
getTrailersback to summary
public HttpFields getTrailers()

Implements org.eclipse.jetty.client.Response.getTrailers.

Returns:HttpFields

Doc from org.eclipse.jetty.client.Response.getTrailers.

the trailers of this response

Annotations
@Override
getVersionback to summary
public HttpVersion getVersion()

Implements org.eclipse.jetty.client.Response.getVersion.

Returns:HttpVersion

Doc from org.eclipse.jetty.client.Response.getVersion.

the HTTP version of this response, such as "HTTP/1.1"

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override