Utility class for XML response parsing.
convertElementToProperty
protected static Property convertElementToProperty(XMLResponseMethodBase.Response response,
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.
generateRequestBody
protected String generateRequestBody()
DAV requests that contain a body must override this function to
generate that body.
The default behavior simply returns an empty body.
getDebug
public int getDebug()
Debug property getter.
getRequestContentLength
protected int getRequestContentLength()
Return the length (in bytes) of my request body, suitable for use in a
Content-Length header.
Return
-1 when the content-length is unknown.
This implementation returns
0, indicating that the request has
no body.
- getRequestContentLength in interface HttpRequestBodyMethodBase
- 0, indicating that the request has no body.
getResponseDocument
public Document getResponseDocument()
Response document getter.
- Document response document
getResponseHashtable
protected Hashtable getResponseHashtable()
getResponseURLs
protected Vector getResponseURLs()
getResponses
public Enumeration getResponses()
Return an enumeration containing the responses.
- An enumeration containing objects implementing the
ResponseEntity interface
parseResponse
public void parseResponse(InputStream input,
HttpState state,
HttpConnection conn)
throws IOException,
HttpException
Parse response.
parseXMLResponse
protected void parseXMLResponse(InputStream input)
throws IOException,
HttpException
readResponseBody
protected void readResponseBody(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
setDebug
public void setDebug(int debug)
Debug property setter.
setDecodeResponseHrefs
public void setDecodeResponseHrefs(String encoding)
Sets whether the href in responses are decoded, as early as possible.
The 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)
setDocument
protected void setDocument(Document doc)
setResponseHashtable
protected void setResponseHashtable(Hashtable h)
writeRequestBody
protected boolean writeRequestBody(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
Write the request body to the given
HttpConnection
.
This implementation writes any computed body and returns
true.
- writeRequestBody in interface HttpRequestBodyMethodBase
state
- the client stateconn
- the connection to write to