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_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, 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 java.lang.String getResponseContent()
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic byte[] getResponseContentBytes()
protected void onResponseStatus(Buffer version, int status, Buffer reason) throws java.io.IOException
HttpExchangeonResponseStatus in class CachedExchangeversion - 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
HttpExchangeonResponseHeader in class CachedExchangename - the header namevalue - the header valuejava.io.IOException - allowed to be thrown by overriding codeprotected void onResponseContent(Buffer content) throws java.io.IOException
HttpExchangeonResponseContent in class HttpExchangecontent - the buffer holding the content chunkjava.io.IOException - allowed to be thrown by overriding codeprotected void onRetry()
throws java.io.IOException
HttpExchangeonRetry in class HttpExchangejava.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.IOExceptionCopyright © 2013 FuseSource, Corp.. All Rights Reserved.