org.apache.webdav.lib.methods
Class XMLResponseMethodBase

java.lang.Object
  |
  +--org.apache.webdav.lib.methods.WebdavMethodBase
        |
        +--org.apache.webdav.lib.methods.XMLResponseMethodBase
All Implemented Interfaces:
WebdavMethod
Direct Known Subclasses:
CopyMethod, DeleteMethod, LockMethod, PropFindMethod, PropPatchMethod

public class XMLResponseMethodBase
extends WebdavMethodBase

Utility class for XML response parsing.

Author:
B.C. Holmes, Remy Maucherat

Inner Class Summary
(package private) static class XMLResponseMethodBase.GetLastModifiedPropertyImpl
          This represents a DAV:getlastmodified property.
(package private) static class XMLResponseMethodBase.PropertyImpl
          This class implements the Property interface and provides basic methods for reading the property.
(package private) static class XMLResponseMethodBase.ResourceTypePropertyImpl
          This represents a DAV:resourcetype property.
 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 static javax.xml.parsers.DocumentBuilder builder
          Document builder.
 
Fields inherited from class org.apache.webdav.lib.methods.WebdavMethodBase
debug, headers, name, path, state, statusCode, statusText
 
Fields inherited from interface org.apache.webdav.lib.methods.WebdavMethod
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()
           
 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.webdav.lib.methods.WebdavMethodBase
checkNotUsed, checkUsed, followRedirects, generateHeaders, generateHeaders, generateQuery, generateRequestLine, getHeader, getHeaders, getName, getPath, getStatusCode, getStatusText, hasBeenUsed, isStreamedQuery, processResponseHeaders, removeHeader, setDebug, setHeader, setPath, 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 static 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()

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 WebdavMethodBase

parseResponse

public void parseResponse(java.io.InputStream input)
                   throws java.io.IOException,
                          WebdavException
Parse response.
Overrides:
parseResponse in class WebdavMethodBase
Parameters:
input - Input stream

parseXMLResponse

protected void parseXMLResponse(java.io.InputStream input)
                         throws java.io.IOException,
                                WebdavException

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.