org.apache.webdav.lib.methods
Class PropFindMethod
- DepthSupport
public class PropFindMethod
This class implements the WebDAV PROPFIND Method.
The PROPFIND 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:
PROPFIND /file HTTP/1.1
Host: www.foo.bar
Content-type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop xmlns:R="http://www.foo.bar/boxschema/">
<R:bigbox/>
<R:author/>
<R:DingALing/>
<R:Random/>
</D:prop>
</D:propfind>
static int | ALL - Request of all properties name and value.
|
static int | BY_NAME - Request of named properties.
|
static int | NAMES - Request of all properties name.
|
protected int | depth - Depth.
|
protected String | prefix - The namespace abbreviation that prefixes DAV tags
|
protected PropertyName[] | propertyNames - Property name list.
|
protected int | type - Type of the Propfind.
|
convertElementToProperty , generateRequestBody , getDebug , getRequestContentLength , getResponseDocument , getResponseHashtable , getResponseURLs , getResponses , parseResponse , parseXMLResponse , readResponseBody , recycle , setDebug , setDecodeResponseHrefs , setDocument , setResponseHashtable , writeRequestBody |
ALL
public static final int ALL
Request of all properties name and value.
BY_NAME
public static final int BY_NAME
Request of named properties.
NAMES
public static final int NAMES
Request of all properties name.
depth
protected int depth
Depth.
prefix
protected String prefix
The namespace abbreviation that prefixes DAV tags
propertyNames
protected PropertyName[] propertyNames
Property name list.
type
protected int type
Type of the Propfind.
PropFindMethod
public PropFindMethod()
Method constructor.
PropFindMethod
public PropFindMethod(String path)
Method constructor.
PropFindMethod
public PropFindMethod(String path,
Enumeration propertyNames)
Method constructor.
PropFindMethod
public PropFindMethod(String path,
int depth)
Method constructor.
PropFindMethod
public PropFindMethod(String path,
int depth,
Enumeration propertyNames)
Method constructor.
PropFindMethod
public PropFindMethod(String path,
int depth,
int type)
Method constructor.
addRequestHeaders
public void addRequestHeaders(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
Generate additional headers needed by the request.
state
- State tokenconn
- The connection being used to make the request.
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.
- generateRequestBody in interface XMLResponseMethodBase
getAllResponseURLs
public Enumeration getAllResponseURLs()
This method returns an enumeration of URL paths. If the PropFindMethod
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.
- an enumeration of URL paths as Strings
getName
public String getName()
getResponseProperties
public Enumeration getResponseProperties(String urlPath)
Returns an enumeration of Property
objects.
getType
public int getType()
Type getter.
setPropertyNames
public void setPropertyNames(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.
propertyNames
- List of the property names
setRequestHeader
public void setRequestHeader(String headerName,
String headerValue)
Set a request header value, redirecting the special case of the "Depth" header
to invoke
setDepth(int)
instead.
headerName
- Header nameheaderValue
- Header value
setType
public void setType(int type)
Type setter.