org.apache.webdav.lib.methods
Class XMLResponseMethodBase

java.lang.Object
  |
  +--org.apache.commons.httpclient.HttpMethodBase
        |
        +--org.apache.webdav.lib.methods.XMLResponseMethodBase
All Implemented Interfaces:
org.apache.commons.httpclient.HttpMethod
Direct Known Subclasses:
CopyMethod, DeleteMethod, LockMethod, MoveMethod, PropFindMethod, PropPatchMethod, SearchMethod

public class XMLResponseMethodBase
extends org.apache.commons.httpclient.HttpMethodBase

Utility class for XML response parsing.

Author:
B.C. Holmes, Remy Maucherat, Dirk Verbeeck

Inner Class Summary
 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
           
 
Field Summary
protected  javax.xml.parsers.DocumentBuilder builder
          Document builder.
 
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
debug, followRedirects, name, parameters, path, query, queryString, requestHeaders, responseHeaders, state, statusCode, statusText
 
Fields inherited from interface org.apache.commons.httpclient.HttpMethod
PROTOCOL
 
Constructor Summary
XMLResponseMethodBase()
          Method constructor.
XMLResponseMethodBase(java.lang.String path)
          Method constructor.
 
Method Summary
protected static Property convertElementToProperty(XMLResponseMethodBase.Response response, org.w3c.dom.Element element)
          This method creates a property implementation from an element.
 org.w3c.dom.Document getResponseDocument()
          Response document getter.
protected  java.util.Hashtable getResponseHashtable()
           
 java.util.Enumeration getResponses()
          Return an enumeration containing the responses.
protected  org.apache.commons.httpclient.State getState()
           
 void parseResponse(java.io.InputStream input)
          Parse response.
protected  void parseXMLResponse(java.io.InputStream input)
           
 void recycle()
          Reset the State of the class to its initial state, so that it can be used again.
 
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
checkNotUsed, checkUsed, followRedirects, generateHeaders, generateHeaders, generateQuery, generateRequestLine, generateRequestLine, getHeader, getHeaders, getHeadersHashtable, getName, getPath, getStatusCode, getStatusText, hasBeenUsed, hasResponseBody, isStreamedQuery, needContentLength, needExpectation, processResponseHeaders, removeHeader, setDebug, setFollowRedirects, setHeader, setParameter, setPath, setQuery, setQueryString, setState, setStatusCode, setStatusText, setUsed, streamQuery, validate
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builder

protected javax.xml.parsers.DocumentBuilder builder
Document builder.
Constructor Detail

XMLResponseMethodBase

public XMLResponseMethodBase()
Method constructor.

XMLResponseMethodBase

public XMLResponseMethodBase(java.lang.String path)
Method constructor.
Method Detail

getResponseDocument

public org.w3c.dom.Document getResponseDocument()
Response document getter.
Returns:
Document response document

getResponses

public java.util.Enumeration getResponses()
Return an enumeration containing the responses.
Returns:
An enumeration containing objects implementing the ResponseEntity interface

getState

protected org.apache.commons.httpclient.State getState()

recycle

public void recycle()
Reset the State of the class to its initial state, so that it can be used again.
Overrides:
recycle in class org.apache.commons.httpclient.HttpMethodBase

parseResponse

public void parseResponse(java.io.InputStream input)
                   throws java.io.IOException,
                          org.apache.commons.httpclient.HttpException
Parse response.
Overrides:
parseResponse in class org.apache.commons.httpclient.HttpMethodBase
Parameters:
input - Input stream

parseXMLResponse

protected void parseXMLResponse(java.io.InputStream input)
                         throws java.io.IOException,
                                org.apache.commons.httpclient.HttpException

getResponseHashtable

protected java.util.Hashtable getResponseHashtable()

convertElementToProperty

protected static Property convertElementToProperty(XMLResponseMethodBase.Response response,
                                                   org.w3c.dom.Element element)
This method creates a property implementation from an element. It treats known properties (i.e., the DAV properties) specially. These properties are instantiated as an implementation from the org.apache.webdav.lib.properties package.