This section outlines the common terms you will encounter as you work with WebDAV.
URI. A URI (Uniform Resource Identifier) is a file identifier that provides an additional layer of security by using an abbreviated URL. The first part of the URL is substituted with a URL mapping that hides the file’s full physical pathname from the user.
Source URI. The term, source URI, refers to the URI at which a resource’s source can be accessed. To understand the concept of source URI, consider the following example:
A JSP page, foo.jsp, is located at the URI /docs/date.jsp. This page contains HTML markup and Java code which, when executed, prints today’s date on the client’s browser. When the server receives a GET request for foo.jsp from a client, before serving the page it executes the Java code. What the client receives is not foo.jsp as it resides on the server but instead a dynamically generated page that displays the current date.
If you were to create a source URI, say /publish/docs, and map it to the /docs directory containing foo.jsp, then a request for /publish/docs/foo.jsp will be a request for the source code of the /docs/foo.jsp JSP page. In this case, the server will serve the page without executing the Java code. The client will receive the unprocessed page exactly as stored on disk.
A request for the source URI is thus a request for the source of the resource.
Collection. A WebDAV collection is a resource or a set of resources that are enabled for WebDAV operations. A collection contains a set of URIs, termed member URIs, which identify member resources that are WebDAV-enabled.
Member URI. A URI which is a member of the set of URIs inside a collection.
Internal Member URI. A Member URI that is immediately relative to the URI of the collection. For example, if the resource with the URL http://info.sun.com/resources/info is WebDAV-enabled and if the resource with the URL http://info.sun.com/resources/ is also WebDAV-enabled, then the resource with the URL http://info.sun.com/resources/ is a collection and contains http://info.sun.com/resources/info as an internal member.
Property. A name/value pair that contains descriptive information about a resource. Properties are used for efficient discovery and management of resources. For example, a ’creationdate’ property might allow for the indexing of all resources by the date on which the resources were created, and an ’author’ property, for indexing by author name.
Live Property. A property that is enforced by the server. For example, the live getcontentlength property has as its value, the length of the entity returned by a GET request, which is automatically calculated by the server. Live properties include the following:
The value of a property is read-only, maintained by the server
The value of the property is maintained by the client, but the server performs syntax checking on submitted values.
Dead Property. A property that is not enforced by the server. The server only records the value of a dead property; the client is responsible for maintaining its consistency.
Sun Java System Web Server supports the following live properties:
creationdate
displayname
getcontentlanguage
getcontentlength
getcontenttype
gettag
getlastmodified
lockdiscovery
resourcetype
supportedlock
executable
Sun Java System Web Server supports the live property executable that allows clients to change the file permissions associated with a resource.
An example of a PROPPATCH request for the executable live property:
PROPPATCH /test/index.html HTTP/1.1
Host: sun
Content-type: text/xml
Content-length: XXXX
<?xml version="1.0"?>
<A:propertyupdate xmlns:A="DAV:" xmlns:B="http://apache.org/dav/props/">
<A:set>
<A:prop>
<B:executable>T</B:executable>
</A:prop>
</A:set>
</A:propertyupdate>
Locking. The ability to lock a resource provides a mechanism to guarantee that one user will not modify a resource while it is being edited by another. Locking prevents overwrite conflicts and resolves the "lost updates" problem.
Sun Java System Web Server supports two types of locking: shared and exclusive.
New HTTP Headers. WebDAV works by extending the HTTP/1.1 protocol. It defines new HTTP headers by which clients can communicate requests for WebDAV resources. These headers are:
Destination:
Lock-Token:
Timeout:
DAV:
If:
Depth:
Overwrite:
New HTTP Methods. WebDAV introduces several new HTTP methods that instruct WebDAV-enabled servers how to handle requests. These methods are used in addition to existing HTTP methods such as GET, PUT, and DELETE to carry out WebDAV transactions. The new HTTP methods are briefly described below:
COPY. Used to copy resources. Copying collections uses the Depth: header while the Destination: header specifies the target. The COPY method also uses the Overwrite: header, as appropriate.
MOVE. Used to move resources. Moving collections uses the Depth: header while the Destination: header specifies the target. The MOVE method also uses the Overwrite: header, as appropriate.
MKCOL. Used to create a new collection. This method is used to avoid overloading the PUT method.
PROPPATCH. Used to set, change, or delete properties on a single resource.
PROPFIND. Used to fetch one or more properties belonging to one or more resources. When a client submits a PROPFIND request on a collection to the server, the request may include a Depth: header with a value of 0, 1, or infinity.
0. Specifies that the properties of the collection at the specified URI will be fetched.
1. Specifies that the properties of the collection and resources immediately under the specified URI will be fetched.
infinity. Specifies that the properties of the collection and all member URIs it contains will be fetched. Be aware that because a request with infinite depth will crawl the entire collection, it can impose a large burden on the server.
UNLOCK. Removes locks from resources. Uses the Lock-Token: header.