Package com.ning.http.client.webdav
Class WebDavResponse
java.lang.Object
com.ning.http.client.webdav.WebDavResponse
- All Implemented Interfaces:
Response
Customized
Response which add support for getting the response's body as an XML document (@link WebDavResponse#getBodyAsXML}-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ning.http.client.Response
Response.ResponseBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the content-type header value.Return the list ofCookie.Return the response headergetHeaders(String name) Return aListof the response header value.Return the entire response body as a String.getResponseBody(String charset) Return the entire response body as a String.Return the entire response body as a ByteBuffer.byte[]Return the entire response body as a byte[].Returns an input stream for the response body.getResponseBodyExcerpt(int maxLength) Returns the first maxLength bytes of the response body as a string.getResponseBodyExcerpt(int maxLength, String charset) Returns the first maxLength bytes of the response body as a string.intReturns the status code for the request.Returns the status text for the request.getUri()Return the requestUri.booleanReturn true if the response's body has been computed by anAsyncHandler.booleanReturn true if the response's headers has been computed by anAsyncHandlerIt will return false if the eitherAsyncHandler.onStatusReceived(HttpResponseStatus)orAsyncHandler.onHeadersReceived(HttpResponseHeaders)returnedAsyncHandler.STATE.ABORTbooleanReturn true if the response's status has been computed by anAsyncHandlerbooleanReturn true if the response redirects to another object.
-
Constructor Details
-
WebDavResponse
-
-
Method Details
-
getStatusCode
public int getStatusCode()Description copied from interface:ResponseReturns the status code for the request.- Specified by:
getStatusCodein interfaceResponse- Returns:
- The status code
-
getStatusText
Description copied from interface:ResponseReturns the status text for the request.- Specified by:
getStatusTextin interfaceResponse- Returns:
- The status text
-
getResponseBodyAsBytes
Description copied from interface:ResponseReturn the entire response body as a byte[].- Specified by:
getResponseBodyAsBytesin interfaceResponse- Returns:
- the entire response body as a byte[].
- Throws:
IOException
-
getResponseBodyAsByteBuffer
Description copied from interface:ResponseReturn the entire response body as a ByteBuffer.- Specified by:
getResponseBodyAsByteBufferin interfaceResponse- Returns:
- the entire response body as a ByteBuffer.
- Throws:
IOException
-
getResponseBodyAsStream
Description copied from interface:ResponseReturns an input stream for the response body. Note that you should not try to get this more than once, and that you should not close the stream.- Specified by:
getResponseBodyAsStreamin interfaceResponse- Returns:
- The input stream
- Throws:
IOException
-
getResponseBodyExcerpt
Description copied from interface:ResponseReturns the first maxLength bytes of the response body as a string. Note that this does not check whether the content type is actually a textual one, but it will use the charset if present in the content type header.- Specified by:
getResponseBodyExcerptin interfaceResponse- Parameters:
maxLength- The maximum number of bytes to read- Returns:
- The response body
- Throws:
IOException
-
getResponseBodyExcerpt
Description copied from interface:ResponseReturns the first maxLength bytes of the response body as a string. Note that this does not check whether the content type is actually a textual one, but it will use the charset if present in the content type header.- Specified by:
getResponseBodyExcerptin interfaceResponse- Parameters:
maxLength- The maximum number of bytes to readcharset- the charset to use when decoding the stream- Returns:
- The response body
- Throws:
IOException
-
getResponseBody
Description copied from interface:ResponseReturn the entire response body as a String.- Specified by:
getResponseBodyin interfaceResponse- Returns:
- the entire response body as a String.
- Throws:
IOException
-
getResponseBody
Description copied from interface:ResponseReturn the entire response body as a String.- Specified by:
getResponseBodyin interfaceResponse- Parameters:
charset- the charset to use when decoding the stream- Returns:
- the entire response body as a String.
- Throws:
IOException
-
getUri
Description copied from interface:Response -
getContentType
Description copied from interface:ResponseReturn the content-type header value.- Specified by:
getContentTypein interfaceResponse- Returns:
- the content-type header value.
-
getHeader
Description copied from interface:ResponseReturn the response header -
getHeaders
Description copied from interface:ResponseReturn aListof the response header value.- Specified by:
getHeadersin interfaceResponse- Returns:
- the response header
-
getHeaders
- Specified by:
getHeadersin interfaceResponse
-
isRedirected
public boolean isRedirected()Description copied from interface:ResponseReturn true if the response redirects to another object.- Specified by:
isRedirectedin interfaceResponse- Returns:
- True if the response redirects to another object.
-
getCookies
Description copied from interface:ResponseReturn the list ofCookie.- Specified by:
getCookiesin interfaceResponse
-
hasResponseStatus
public boolean hasResponseStatus()Description copied from interface:ResponseReturn true if the response's status has been computed by anAsyncHandler- Specified by:
hasResponseStatusin interfaceResponse- Returns:
- true if the response's status has been computed by an
AsyncHandler
-
hasResponseHeaders
public boolean hasResponseHeaders()Description copied from interface:ResponseReturn true if the response's headers has been computed by anAsyncHandlerIt will return false if the eitherAsyncHandler.onStatusReceived(HttpResponseStatus)orAsyncHandler.onHeadersReceived(HttpResponseHeaders)returnedAsyncHandler.STATE.ABORT- Specified by:
hasResponseHeadersin interfaceResponse- Returns:
- true if the response's headers has been computed by an
AsyncHandler
-
hasResponseBody
public boolean hasResponseBody()Description copied from interface:ResponseReturn true if the response's body has been computed by anAsyncHandler. It will return false if the eitherAsyncHandler.onStatusReceived(HttpResponseStatus)orAsyncHandler.onHeadersReceived(HttpResponseHeaders)returnedAsyncHandler.STATE.ABORT- Specified by:
hasResponseBodyin interfaceResponse- Returns:
- true if the response's body has been computed by an
AsyncHandler
-
getBodyAsXML
-