public class ContentExchange extends CachedExchange
HttpExchange.CachedExchange, HttpExchange.ContentExchangeSTATUS_CANCELLED, STATUS_CANCELLING, STATUS_COMPLETED, STATUS_EXCEPTED, STATUS_EXPIRED, STATUS_PARSING_CONTENT, STATUS_PARSING_HEADERS, STATUS_SENDING_COMPLETED, STATUS_SENDING_PARSING_CONTENT, STATUS_SENDING_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 |
|---|---|
File |
getFileForUpload() |
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(File fileForUpload) |
getResponseFields, getResponseStatusaddRequestHeader, 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, waitForStatuspublic ContentExchange()
public ContentExchange(boolean cacheFields)
public String getResponseContent() throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic byte[] getResponseContentBytes()
protected void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException
HttpExchangeonResponseStatus in class CachedExchangeversion - the HTTP versionstatus - the HTTP status codereason - the HTTP status reason stringIOException - allowed to be thrown by overriding codeprotected void onResponseHeader(Buffer name, Buffer value) throws IOException
HttpExchangeonResponseHeader in class CachedExchangename - the header namevalue - the header valueIOException - allowed to be thrown by overriding codeprotected void onResponseContent(Buffer content) throws IOException
HttpExchangeonResponseContent in class HttpExchangecontent - the buffer holding the content chunkIOException - allowed to be thrown by overriding codeprotected void onRetry()
throws IOException
HttpExchangeonRetry in class HttpExchangeIOException - allowed to be thrown by overriding codepublic File getFileForUpload()
public void setFileForUpload(File fileForUpload) throws IOException
IOExceptionCopyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.