org.eclipse.jetty.client
public class ContentExchange extends CachedExchange
HttpExchange.CachedExchange, HttpExchange.ContentExchange
STATUS_CANCELLED, STATUS_CANCELLING, STATUS_COMPLETED, STATUS_EXCEPTED, STATUS_EXPIRED, STATUS_PARSING_CONTENT, STATUS_PARSING_HEADERS, STATUS_SENDING_REQUEST, STATUS_START, STATUS_WAITING_FOR_COMMIT, STATUS_WAITING_FOR_CONNECTION, STATUS_WAITING_FOR_RESPONSE
Constructor and Description |
---|
ContentExchange() |
ContentExchange(boolean cacheFields) |
Modifier and Type | Method and Description |
---|---|
java.io.File |
getFileForUpload() |
java.lang.String |
getResponseContent() |
byte[] |
getResponseContentBytes() |
protected void |
onResponseContent(Buffer content)
Callback called for each chunk of the response content received from the server.
|
protected void |
onResponseHeader(Buffer name,
Buffer value)
Callback called for each response header received from the server.
|
protected void |
onResponseStatus(Buffer version,
int status,
Buffer reason)
Callback called when a response status line has been received from the server.
|
protected void |
onRetry()
Callback called when the request is retried (due to failures or authentication).
|
void |
setFileForUpload(java.io.File fileForUpload) |
getResponseFields, getResponseStatus
addRequestHeader, addRequestHeader, cancel, cancelTimeout, configureListeners, expire, getAddress, getEventListener, getLocalAddress, getMethod, getRequestContent, getRequestContentChunk, getRequestContentSource, getRequestFields, getRequestURI, getRetryStatus, getScheme, getStatus, getTimeout, getURI, getVersion, isDone, isDone, onConnectionFailed, onException, onExpire, onRequestCommitted, onRequestComplete, onResponseComplete, onResponseHeaderComplete, onSwitchProtocol, reset, scheduleTimeout, setAddress, setConfigureListeners, setEventListener, setMethod, setRequestContent, setRequestContentSource, setRequestContentType, setRequestHeader, setRequestHeader, setRequestURI, setRetryStatus, setScheme, setScheme, setTimeout, setURI, setURI, setURL, setVersion, setVersion, toState, toString, waitForDone, waitForStatus
public ContentExchange()
public ContentExchange(boolean cacheFields)
public java.lang.String getResponseContent() throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public byte[] getResponseContentBytes()
protected void onResponseStatus(Buffer version, int status, Buffer reason) throws java.io.IOException
HttpExchange
onResponseStatus
in class CachedExchange
version
- the HTTP versionstatus
- the HTTP status codereason
- the HTTP status reason stringjava.io.IOException
- allowed to be thrown by overriding codeprotected void onResponseHeader(Buffer name, Buffer value) throws java.io.IOException
HttpExchange
onResponseHeader
in class CachedExchange
name
- the header namevalue
- the header valuejava.io.IOException
- allowed to be thrown by overriding codeprotected void onResponseContent(Buffer content) throws java.io.IOException
HttpExchange
onResponseContent
in class HttpExchange
content
- the buffer holding the content chunkjava.io.IOException
- allowed to be thrown by overriding codeprotected void onRetry() throws java.io.IOException
HttpExchange
onRetry
in class HttpExchange
java.io.IOException
- allowed to be thrown by overriding codepublic java.io.File getFileForUpload()
public void setFileForUpload(java.io.File fileForUpload) throws java.io.IOException
java.io.IOException
Copyright © 2016. All Rights Reserved.