org.apache.webdav.lib.methods
Class ReportMethod

java.lang.Object
  extended byorg.apache.commons.httpclient.HttpMethodBase
      extended byorg.apache.webdav.lib.methods.HttpRequestBodyMethodBase
          extended byorg.apache.webdav.lib.methods.XMLResponseMethodBase
              extended byorg.apache.webdav.lib.methods.ReportMethod
All Implemented Interfaces:
DepthSupport, HttpMethod

public class ReportMethod
extends XMLResponseMethodBase
implements DepthSupport

This class implements the WebDAV REPORT Method.

The REPORT method retrieves properties defined on the resource identified by the Request-URI, if the resource does not have any internal members, or on the resource identified by the Request-URI and potentially its member resources, if the resource is a collection that has internal member URIs.

A typical request looks like this:


Nested Class Summary
 
Nested classes inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
XMLResponseMethodBase.OptionsResponse, XMLResponseMethodBase.Response, XMLResponseMethodBase.ResponseWithinMultistatus, XMLResponseMethodBase.SingleResponse
 
Field Summary
static int ALL
          Request of all properties name and value.
protected  int depth
          Depth.
static int LOCATE_HISTORY
           
protected  java.lang.String prefix
          The namespace abbreviation that prefixes DAV tags
protected  PropertyName[] propertyNames
          Property name list.
static int SUB_SET
          Request specified properties.
 java.lang.String sVersionHistory
           
protected  int type
          Type of the Propfind.
 
Fields inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
builder, responseURLs
 
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
USER_AGENT
 
Fields inherited from interface org.apache.webdav.lib.methods.DepthSupport
DEPTH_0, DEPTH_1, DEPTH_INFINITY
 
Constructor Summary
ReportMethod()
          Method constructor.
ReportMethod(java.lang.String path)
          Method constructor.
ReportMethod(java.lang.String path, java.util.Enumeration propertyNames)
          Method constructor.
ReportMethod(java.lang.String path, int depth)
          Method constructor.
ReportMethod(java.lang.String path, int depth, java.util.Enumeration propertyNames)
          Method constructor.
ReportMethod(java.lang.String path, int depth, java.util.Enumeration propertyNames, java.util.Enumeration histUrl)
          Method constructor.
ReportMethod(java.lang.String path, int depth, java.lang.String sBody)
           
 
Method Summary
 void addRequestHeaders(HttpState state, HttpConnection conn)
          Generate additional headers needed by the request.
protected  java.lang.String generateRequestBody()
          DAV requests that contain a body must override this function to generate that body.
 java.util.Enumeration getAllResponseURLs()
          This method returns an enumeration of URL paths.
 int getDepth()
          Depth getter.
 java.lang.String getName()
           
 java.util.Enumeration getResponseProperties(java.lang.String urlPath)
          Returns an enumeration of Property objects.
 int getType()
          Type getter.
 void recycle()
          Reset the State of the class to its initial state, so that it can be used again.
 void setDepth(int depth)
          Depth setter.
 void setHistoryURLs(java.util.Enumeration historyURLs)
          sets History URL for locate by history Report
 void setPropertyNames(java.util.Enumeration propertyNames)
          Property names setter.
 void setRequestHeader(java.lang.String headerName, java.lang.String headerValue)
          Set a header value, redirecting attempts to set the "Depth" header to a setDepth(int) call.
 void setType(int type)
          Type setter.
 
Methods inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
convertElementToProperty, getDebug, getRequestContentLength, getResponseDocument, getResponseHashtable, getResponses, getResponseURLs, parseResponse, parseXMLResponse, readResponseBody, setDebug, setDocument, setResponseHashtable, writeRequestBody
 
Methods inherited from class org.apache.webdav.lib.methods.HttpRequestBodyMethodBase
isRequestContentAlreadySet, readContinueCode, setRequestBody, setRequestBody, setRequestBody, setRequestBody, setRequestBody
 
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
addAuthorizationRequestHeader, addContentLengthRequestHeader, addCookieRequestHeader, addHostRequestHeader, addProxyAuthorizationRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, fakeResponse, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getFollowRedirects, getHostConfiguration, getMethodRetryHandler, getPath, getProxyAuthenticationRealm, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isConnectionCloseForced, isHttp11, isStrictMode, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setPath, setQueryString, setQueryString, setRequestHeader, setResponseStream, setStrictMode, shouldCloseConnection, validate, writeRequest, writeRequestHeaders, writeRequestLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUB_SET

public static final int SUB_SET
Request specified properties.

See Also:
Constant Field Values

ALL

public static final int ALL
Request of all properties name and value.

See Also:
Constant Field Values

LOCATE_HISTORY

public static final int LOCATE_HISTORY
See Also:
Constant Field Values

sVersionHistory

public java.lang.String sVersionHistory

type

protected int type
Type of the Propfind.


propertyNames

protected PropertyName[] propertyNames
Property name list.


depth

protected int depth
Depth.


prefix

protected java.lang.String prefix
The namespace abbreviation that prefixes DAV tags

Constructor Detail

ReportMethod

public ReportMethod()
Method constructor.


ReportMethod

public ReportMethod(java.lang.String path)
Method constructor.


ReportMethod

public ReportMethod(java.lang.String path,
                    int depth)
Method constructor.


ReportMethod

public ReportMethod(java.lang.String path,
                    java.util.Enumeration propertyNames)
Method constructor.


ReportMethod

public ReportMethod(java.lang.String path,
                    int depth,
                    java.util.Enumeration propertyNames,
                    java.util.Enumeration histUrl)
Method constructor.


ReportMethod

public ReportMethod(java.lang.String path,
                    int depth,
                    java.util.Enumeration propertyNames)
Method constructor.


ReportMethod

public ReportMethod(java.lang.String path,
                    int depth,
                    java.lang.String sBody)
Method Detail

setRequestHeader

public void setRequestHeader(java.lang.String headerName,
                             java.lang.String headerValue)
Set a header value, redirecting attempts to set the "Depth" header to a setDepth(int) call.

Specified by:
setRequestHeader in interface HttpMethod
Parameters:
headerName - Header name
headerValue - Header value

setType

public void setType(int type)
Type setter.

Parameters:
type - New type value

getType

public int getType()
Type getter.

Returns:
int type value

setDepth

public void setDepth(int depth)
Depth setter.

Specified by:
setDepth in interface DepthSupport
Parameters:
depth - New depth value

getDepth

public int getDepth()
Depth getter.

Specified by:
getDepth in interface DepthSupport
Returns:
int depth value

setPropertyNames

public void setPropertyNames(java.util.Enumeration propertyNames)
Property names setter. The enumeration may contain strings with or without a namespace prefix but the preferred way is to provide PropertyName objects.

Parameters:
propertyNames - List of the property names

setHistoryURLs

public void setHistoryURLs(java.util.Enumeration historyURLs)
sets History URL for locate by history Report


getName

public java.lang.String getName()
Specified by:
getName in interface HttpMethod

recycle

public void recycle()
Description copied from class: XMLResponseMethodBase
Reset the State of the class to its initial state, so that it can be used again.

Specified by:
recycle in interface HttpMethod
Overrides:
recycle in class XMLResponseMethodBase

addRequestHeaders

public void addRequestHeaders(HttpState state,
                              HttpConnection conn)
                       throws java.io.IOException,
                              HttpException
Generate additional headers needed by the request.

Parameters:
state - State token
conn - The connection being used to make the request.
Throws:
java.io.IOException
HttpException

generateRequestBody

protected java.lang.String generateRequestBody()
DAV requests that contain a body must override this function to generate that body.

The default behavior simply returns an empty body.

Overrides:
generateRequestBody in class XMLResponseMethodBase

getAllResponseURLs

public java.util.Enumeration getAllResponseURLs()
This method returns an enumeration of URL paths. If the ReportMethod was sent to the URL of a collection, then there will be multiple URLs. The URLs are picked out of the <D:href> elements of the response.

Returns:
an enumeration of URL paths as Strings

getResponseProperties

public java.util.Enumeration getResponseProperties(java.lang.String urlPath)
Returns an enumeration of Property objects.