AclMethod
, AclReportMethod
, BindMethod
, CheckinMethod
, CheckoutMethod
, CopyMethod
, DeleteMethod
, LabelMethod
, LockMethod
, MkWorkspaceMethod
, MoveMethod
, OptionsMethod
, PollMethod
, PropFindMethod
, PropPatchMethod
, RebindMethod
, ReportMethod
, SearchMethod
, SubscribeMethod
, UnbindMethod
, UncheckoutMethod
, UnlockMethod
, UnsubscribeMethod
, UpdateMethod
, VersionControlMethod
public abstract class XMLResponseMethodBase extends HttpRequestBodyMethodBase
Modifier and Type | Class | Description |
---|---|---|
(package private) class |
XMLResponseMethodBase.OptionsResponse |
|
class |
XMLResponseMethodBase.Response |
An abstract class that models a DAV:response.
|
(package private) class |
XMLResponseMethodBase.ResponseWithinMultistatus |
A class that models the DAV:response element within a multistatus.
|
(package private) class |
XMLResponseMethodBase.SingleResponse |
Modifier and Type | Field | Description |
---|---|---|
protected javax.xml.parsers.DocumentBuilder |
builder |
Document builder.
|
protected java.lang.String |
decodeResponseHrefs |
|
protected java.util.Vector |
responseURLs |
Vector of response nodes, to keep track of insertion order
FIXME: the above Hashtable and this Vector should be ported
to plain Collections
|
Constructor | Description |
---|---|
XMLResponseMethodBase() |
Method constructor.
|
XMLResponseMethodBase(java.lang.String uri) |
Method constructor.
|
Modifier and Type | Method | Description |
---|---|---|
protected static Property |
convertElementToProperty(XMLResponseMethodBase.Response response,
org.w3c.dom.Element element) |
This method creates a property implementation from an element.
|
protected java.lang.String |
generateRequestBody() |
DAV requests that contain a body must override this function to
generate that body.
|
int |
getDebug() |
Debug property getter.
|
protected int |
getRequestContentLength() |
Return the length (in bytes) of my request body, suitable for use in a
Content-Length header.
|
org.w3c.dom.Document |
getResponseDocument() |
Response document getter.
|
protected java.util.Hashtable |
getResponseHashtable() |
|
java.util.Enumeration |
getResponses() |
Return an enumeration containing the responses.
|
protected java.util.Vector |
getResponseURLs() |
|
void |
parseResponse(java.io.InputStream input,
org.apache.commons.httpclient.HttpState state,
org.apache.commons.httpclient.HttpConnection conn) |
Parse response.
|
protected void |
parseXMLResponse(java.io.InputStream input) |
|
protected void |
readResponseBody(org.apache.commons.httpclient.HttpState state,
org.apache.commons.httpclient.HttpConnection conn) |
|
void |
recycle() |
Reset the State of the class to its initial state, so that it can be
used again.
|
void |
setDebug(int debug) |
Debug property setter.
|
void |
setDecodeResponseHrefs(java.lang.String encoding) |
Sets whether the href in responses are decoded, as early as possible.
|
protected void |
setDocument(org.w3c.dom.Document doc) |
|
protected void |
setResponseHashtable(java.util.Hashtable h) |
|
protected boolean |
writeRequestBody(org.apache.commons.httpclient.HttpState state,
org.apache.commons.httpclient.HttpConnection conn) |
Write the request body to the given
HttpConnection . |
abort, addCookieRequestHeader, addHostRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addRequestHeaders, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getEffectiveVersion, getFollowRedirects, getHostAuthState, getHostConfiguration, getMethodRetryHandler, getName, getParams, getPath, getProxyAuthenticationRealm, getProxyAuthState, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getRequestHeaders, getResponseBody, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isAborted, isConnectionCloseForced, isHttp11, isRequestSent, isStrictMode, processCookieHeaders, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, setURI, shouldCloseConnection, validate, writeRequest, writeRequestHeaders, writeRequestLine
isRequestContentAlreadySet, readContinueCode, setRequestBody, setRequestBody, setRequestBody, setRequestBody, setRequestBody
protected javax.xml.parsers.DocumentBuilder builder
protected java.util.Vector responseURLs
protected java.lang.String decodeResponseHrefs
public XMLResponseMethodBase()
public XMLResponseMethodBase(java.lang.String uri)
uri
- the URI to requestpublic org.w3c.dom.Document getResponseDocument()
public java.util.Enumeration getResponses()
public void setDebug(int debug)
int
- Debugpublic int getDebug()
public void setDecodeResponseHrefs(java.lang.String encoding)
href
data in responses is often url-encoded, but not
alwyas in a comparable way. Set this to a non-null value to decode the
hrefs as early as possible.encoding
- The encoding used in while decoding (UTF-8 is recommended)public void recycle()
recycle
in class HttpRequestBodyMethodBase
protected void readResponseBody(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws java.io.IOException, org.apache.commons.httpclient.HttpException
readResponseBody
in class org.apache.commons.httpclient.HttpMethodBase
java.io.IOException
org.apache.commons.httpclient.HttpException
protected int getRequestContentLength()
Return -1 when the content-length is unknown.
This implementation returns 0, indicating that the request has no body.
getRequestContentLength
in class HttpRequestBodyMethodBase
protected java.lang.String generateRequestBody()
The default behavior simply returns an empty body.
protected boolean writeRequestBody(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws java.io.IOException, org.apache.commons.httpclient.HttpException
HttpConnection
.
This implementation writes any computed body and returns true.
writeRequestBody
in class HttpRequestBodyMethodBase
state
- the client stateconn
- the connection to write tojava.io.IOException
- when i/o errors occur reading the responseorg.apache.commons.httpclient.HttpException
- when a protocol error occurs or state is invalidpublic void parseResponse(java.io.InputStream input, org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws java.io.IOException, org.apache.commons.httpclient.HttpException
input
- Input streamjava.io.IOException
org.apache.commons.httpclient.HttpException
protected void parseXMLResponse(java.io.InputStream input) throws java.io.IOException, org.apache.commons.httpclient.HttpException
java.io.IOException
org.apache.commons.httpclient.HttpException
protected java.util.Hashtable getResponseHashtable()
protected java.util.Vector getResponseURLs()
protected static Property convertElementToProperty(XMLResponseMethodBase.Response response, org.w3c.dom.Element element)
org.apache.webdav.lib.properties
package.protected void setDocument(org.w3c.dom.Document doc)
protected void setResponseHashtable(java.util.Hashtable h)