org.eclipse.jetty.client
Class ContentExchange
java.lang.Object
org.eclipse.jetty.client.HttpExchange
org.eclipse.jetty.client.CachedExchange
org.eclipse.jetty.client.ContentExchange
- Direct Known Subclasses:
- HttpExchange.ContentExchange
public class ContentExchange
- extends CachedExchange
A exchange that retains response content for later use.
Fields inherited from class org.eclipse.jetty.client.HttpExchange |
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 |
Methods inherited from class org.eclipse.jetty.client.HttpExchange |
addRequestHeader, addRequestHeader, cancel, configureListeners, getAddress, getEventListener, getLocalAddress, getMethod, getRequestContent, getRequestContentChunk, getRequestContentSource, getRequestFields, getRetryStatus, getScheme, getStatus, getTimeout, getURI, getVersion, isDone, isDone, onConnectionFailed, onException, onExpire, onRequestCommitted, onRequestComplete, onResponseComplete, onResponseHeaderComplete, onSwitchProtocol, reset, setAddress, setConfigureListeners, setEventListener, setMethod, setRequestContent, setRequestContentSource, setRequestContentType, setRequestHeader, setRequestHeader, setRetryStatus, setScheme, setTimeout, setURI, setURL, setVersion, setVersion, toString, waitForDone, waitForStatus |
ContentExchange
public ContentExchange()
ContentExchange
public ContentExchange(boolean cacheFields)
getResponseContent
public String getResponseContent()
throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
getResponseContentBytes
public byte[] getResponseContentBytes()
onResponseStatus
protected void onResponseStatus(Buffer version,
int status,
Buffer reason)
throws IOException
- Description copied from class:
HttpExchange
- Callback called when a response status line has been received from the server.
This implementation does nothing.
- Overrides:
onResponseStatus
in class CachedExchange
- Parameters:
version
- the HTTP versionstatus
- the HTTP status codereason
- the HTTP status reason string
- Throws:
IOException
- allowed to be thrown by overriding code
onResponseHeader
protected void onResponseHeader(Buffer name,
Buffer value)
throws IOException
- Description copied from class:
HttpExchange
- Callback called for each response header received from the server.
This implementation does nothing.
- Overrides:
onResponseHeader
in class CachedExchange
- Parameters:
name
- the header namevalue
- the header value
- Throws:
IOException
- allowed to be thrown by overriding code
onResponseContent
protected void onResponseContent(Buffer content)
throws IOException
- Description copied from class:
HttpExchange
- Callback called for each chunk of the response content received from the server.
This implementation does nothing.
- Overrides:
onResponseContent
in class HttpExchange
- Parameters:
content
- the buffer holding the content chunk
- Throws:
IOException
- allowed to be thrown by overriding code
onRetry
protected void onRetry()
throws IOException
- Description copied from class:
HttpExchange
- Callback called when the request is retried (due to failures or authentication).
Implementations must reset any consumable content that needs to be sent.
- Overrides:
onRetry
in class HttpExchange
- Throws:
IOException
- allowed to be thrown by overriding code
getFileForUpload
public File getFileForUpload()
setFileForUpload
public void setFileForUpload(File fileForUpload)
throws IOException
- Throws:
IOException
Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.