Common Lisp Package: CL-WEBDAV

README:

FUNCTION

Public

DAV-NODE (LOCAL-NAME &REST CHILDREN)

Shortcut for MAKE-XMLS-NODE. Returns an XMLS node with the local name LOCAL-NAME, the namespace URI "DAV:", and the children CHILDREN.

LOCAL-NAME (THING)

Returns the local name of the XMLS node or attribute THING.

NAMESPACE-URI (THING)

Returns the namespace URI (which can be NIL) of the XMLS node or attribute THING.

NODE-ATTRIBUTES (XMLS-NODE)

Returns the list of attributes of the XMLS node XMLS-NODE.

SETFNODE-ATTRIBUTES (ATTRIBUTES XMLS-NODE)

Sets the list of attributes of the XMLS node XMLS-NODE to ATTRIBUTES.

NODE-CHILDREN (XMLS-NODE)

Returns the list of children of the XMLS node XMLS-NODE.

SETFNODE-CHILDREN (CHILDREN XMLS-NODE)

Sets the list of children of the XMLS node XMLS-NODE to CHILDREN.

OPTIONS-DISPATCHER (REQUEST)

A dispatcher which'll dispatch to OPTIONS-HANDLER in case of an OPTIONS request and decline otherwise. This is only useful if you want to cater to Microsoft DAV clients which always unconditionally send OPTIONS requests to the "/" root resource. Sigh...

OPTIONS-HANDLER

The handler for OPTIONS requests. Output is basically determined by *ALLOWED-METHODS* and *DAV-COMPLIANCE-CLASSES*.

PARSE-DAV (OCTETS &OPTIONAL ROOT-NAME)

Accepts an array OCTETS of octets representing a DAV XML node and converts it into the corresponding XMLS node. According to the WebDAV RFC, non-DAV elements are skipped unless they appear in positions (like in a "prop" element) where arbitrary elements are allowed. If ROOT-NAME is given, it should be the local name (a string) of a DAV node. In this case, the XML is validated. This function is expected to be called from within a Hunchentoot request and throws to the HANDLER-DONE tag with a return code of +HTTP-BAD-REQUEST+ if a parsing error occurs or if the XML is invalid. This is kind of the inverse operation to SERIALIZE-XMLS-NODE.

SERIALIZE-XMLS-NODE (XMLS-NODE)

Serializes XMLS-NODE to a vector of octets which is returned. This is kind of the inverse operation to PARSE-DAV and very similar to CXML-XMLS:MAP-NODE.

XMLS-NODE-P (THING)

Checks whether THING is an XMLS node. See the docstring of MAKE-XMLS-NODE for a description of the structure of XMLS nodes.

Private

ALL-DEAD-PROPERTY-DESIGNATORS (RESOURCE)

Returns a list of XMLS nodes which are designators for all dead properties for the resource RESOURCE.

ALL-PROPERTY-DESIGNATORS (RESOURCE)

Returns a list of XMLS nodes which are designators for all (dead and live) properties for the resource RESOURCE.

BAD-GATEWAY

Sets RETURN-CODE to +HTTP-BAD-GATEWAY+ and then calls ABORT-REQUEST-HANDLER.

BAD-REQUEST

Sets RETURN-CODE to +HTTP-BAD-REQUEST+ and then calls ABORT-REQUEST-HANDLER.

COLLECT-PROPERTIES (RESOURCE PROPERTY-DESIGNATORS SHOW-CONTENT)

Tries to collect all properties of the resource RESOURCE which are in the list PROPERTY-DESIGNATORS (which can also be the symbol T which means "all dead an live properties". SHOW-CONTENT is interpreted as in PROPSTAT. Returns the corresponding "response" DAV node as an XMLS node.

COMPUTE-REAL-PATH (SCRIPT-NAME)

Computes the "real path" of a file resource from the request's script name.

CONFLICT

Sets RETURN-CODE to +HTTP-CONFLICT+ and then calls ABORT-REQUEST-HANDLER.

CONSTANTLY-NIL (&REST ARGS)

Does the same as the result of (CONSTANTLY NIL).

COPY-HANDLER (&OPTIONAL MOVEP)

The handler for COPY requests which internally uses COPY-OR-MOVE-RESOURCE* to do the actual work. Also doubles as a handler for MOVE requests if MOVEP is true.

COPY-OR-MOVE-RESOURCE* (SOURCE DESTINATION MOVEP DEPTH)

Copies or moves (depending on the generalized boolean MOVEP) the resource denoted by SOURCE to (the resource denoted by) DESTINATION. If DEPTH is NIL, recurses down to the children (if any) as well. Returns a list of conses where the car is an HTTP return code and the cdr is the corresponding (source) resource for exceptional situations encountered during the process.

COPY-PROPERTIES (FROM-KEY TO-KEY)

Copies (using COPY-TREE) properties stored under the (EQUAL) key FROM-KEY (if any) to the key TO-KEY.

CREATION-DATE (RESOURCE)

This is the function that is called for the "creationdate" property. It returns the result of RESOURCE-CREATION-DATE as an ISO 8601 string within a DAV XML node.

DAV-DISPATCHER (REQUEST &OPTIONAL (RESOURCE-CLASS *RESOURCE-CLASS*))

A generic Hunchentoot dispatcher (corresponding to the resource class RESOURCE-CLASS) for all DAV methods. The handler which is returned will have *RESOURCE-CLASS* bound to RESOURCE-CLASS. In theory, you could use this as your dispatcher (which doesn't call ACCEPT-REQUEST-P first), but it's not exported and only used internally by CREATE-DAV-DISPATCHER.

DAV-PROPERTY-FUNCTION (PROPERTY)

Returns the function which is responsible to retrieve the DAV "live" property PROPERTY, where PROPERTY can either be an XMLS node or a string denoting the local name of the corresponding node. If PROPERTY doesn't denote a DAV property, this function returns NIL.

DELETE-HANDLER

The handler for DELETE requests. Uses REMOVE-RESOURCE* to do the actual work.

FAILED-DEPENDENCY

Sets RETURN-CODE to +HTTP-FAILED-DEPENDENCY+ and then calls ABORT-REQUEST-HANDLER.

FORBIDDEN

Sets RETURN-CODE to +HTTP-FORBIDDEN+ and then calls ABORT-REQUEST-HANDLER.

GET-CONTENT-LENGTH (RESOURCE)

This is the function that is called for the "getcontentlength" property. It simply returns the result of RESOURCE-LENGTH as a string.

GET-CONTENT-TYPE (RESOURCE)

This is the function that is called for the "getcontenttype" property. It simply returns the result of RESOURCE-CONTENT-TYPE for non-collections and "httpd/unix-directory" for collections.

GET-DEAD-PROPERTY (RESOURCE PROPERTY-DESIGNATOR)

Returns the dead property denoted by the XMLS node PROPERTY-DESIGNATOR of the resource RESOURCE or +HTTP-NOT-FOUND+ if such a property doesn't exist.

GET-HANDLER (&OPTIONAL HEAD-REQUEST-P)

The handler for GET requests. Serves the contents of the resource using SEND-CONTENT and sets up the HTTP headers correctly. Also doubles as handler for HEAD requests if HEAD-REQUEST-P is true.

GET-LAST-MODIFIED (RESOURCE)

This is the function that is called for the "getlastmodified" property. It returns the result of RESOURCE-WRITE-DATE as an RFC 1123 string within a DAV XML node.

GET-PROPERTY (RESOURCE PROPERTY-DESIGNATOR)

Returns the (live or dead) property denoted by the XMLS node PROPERTY-DESIGNATOR of the resource RESOURCE or +HTTP-NOT-FOUND+ if such a property doesn't exist.

GET-RESOURCE (&OPTIONAL (SCRIPT-NAME (URL-DECODE* (SCRIPT-NAME*))))

Creates and returns an object of the type stored in *RESOURCE-CLASS* corresponding to the script name SCRIPT-NAME.

HEAD-HANDLER

The handler for HEAD requests - the actual work is done by GET-HANDLER.

IGNORE-NON-DAV-ELEMENTS (NODE)

Helper function which recursively walks the XMLS node NODE and returns an equivalent node with all non-DAV elements removed (except for those in :ANY positions).

ISO-8601-DATE (UNIVERSAL-TIME)

Returns a string representing the universal time UNIVERSAL-TIME as an ISO-8601-formatted date.

MAKE-XMLS-BUILDER

Creates and returns an instance of the XMLS-BUILDER class.

MAKE-XMLS-NODE (&KEY LOCAL-NAME NAMESPACE-URI ATTRIBUTES CHILDREN)

Creates and returns an XMLS node with the local name LOCAL-NAME, the namespace URI NAMESPACE-URI, the attributes ATTRIBUTES (a list of attributes) and the children CHILDREN (also a list). An XMLS node is a list with two or more elements where the first element is the name, the second element is the list of attributes, and all the following elements (if any) are the children. The name is either a string (if there is no namespace), or a cons where the car is the local name and the cdr is the namespace URI. An attribute is a list of two elements where the first element is the name and the second element is the value. Attribute names are structured like XMLS node names.

MD5-HEX (STRING)

Calculates the md5 sum of the string STRING and returns it as a hex string.

METHOD-NOT-ALLOWED

Sets RETURN-CODE to +HTTP-METHOD-NOT-ALLOWED+ and then calls ABORT-REQUEST-HANDLER.

MKCOL-HANDLER

The handler for MKCOL requests which uses CREATE-COLLECTION internally.

MOVE-HANDLER

The handler for MOVE requests. Calls COPY-HANDLER to do the actual work.

MOVE-PROPERTIES (FROM-KEY TO-KEY)

Moves properties stored under the (EQUAL) key FROM-KEY (if any) to the key TO-KEY.

MULTI-STATUS (RESULTS &OPTIONAL (DEFAULT-RETURN-CODE +HTTP-NO-CONTENT+))

Utility function which returns a MULTISTATUS response to the HTTP client which is based on RESULTS. RESULTS must be a list of conses where the cdr is the resource and the car is the corresponding status code. If RESULTS is NIL, not MUTILSTATUS response will be generated and DEFAULT-RETURN-CODE will be used instead.

NOT-FOUND

Sets RETURN-CODE to +HTTP-NOT-FOUND+ and then calls ABORT-REQUEST-HANDLER.

NOT-IMPLEMENTED

Sets RETURN-CODE to +HTTP-NOT-IMPLEMENTED+ and then calls ABORT-REQUEST-HANDLER.

PARSE-PROPFIND (OCTETS)

Helper function for PROPFIND-HANDLER which parses the XML stored in OCTETS (an array of octets) which is supposed to be either empty or the body of a PROPFIND request. Returns as its first value a list of the requested properties (as XMLS nodes) or T (denoting all properties) and as its second value a boolean which is T iff the client wants only property names.

PRECONDITION-FAILED

Sets RETURN-CODE to +HTTP-PRECONDITION-FAILED+ and then calls ABORT-REQUEST-HANDLER.

PROPERTY-EQUAL (PROPERTY1 PROPERTY2)

Two (XMLS nodes denoting) properties are equal iff they have the same local name and the same namespace URI.

PROPFIND-HANDLER

The handler for PROPFIND requests. Parses the request's content body (if there is one) and returns a corresponding "multistatus" XML element using the methods for live and dead properties.

PROPPATCH-HANDLER

The handler for PROPPATCH requests. Parses the request's content body, modifies the dead properties as specified and returns a corresponding "multistatus" XML element.

PROPSTAT (RESOURCE PROPERTY-DESIGNATOR SHOW-CONTENT)

Uses GET-PROPERTY to try to retrieve the property designated by PROPERTY-DESIGNATOR from the resource RESOURCE. Returns as its first value an HTTP return code (with +HTTP-OK+ denoting that the property was found) and as its second value the property designator or (if SHOW-CONTENT is true and the property was found) the property itself.

PUT-HANDLER

The handler for PUT requests. Uses GET-CONTENT to create a new resource from the contents sent by the client.

REMOVE-CONTENT (XMLS-NODE)

Returns an XMLS node which has the same name and attributes as the XMLS node XMLS-NODE but an empty body.

REMOVE-PROPERTIES (KEY)

Removes any properties stored under the (EQUAL) key KEY.

REMOVE-RESOURCE* (RESOURCE)

Removes the resource RESOURCE and (if necessary) its children using REMOVE-RESOURCE. Returns a list of conses where the car is an HTTP return code and the cdr is the corresponding resource for exceptional situations encountered during the process.

RESOURCE-CREATED (RESOURCE)

Utility function which sets up Hunchentoot's *REPLY* object for a +HTTP-CREATED+ response corresponding to the newly-created resource RESOURCE.

RESOURCE-HREF (RESOURCE)

Returns a URL-encoded version of the resource's script name for use in HREF elements in property XML.

RESOURCE-NAME (RESOURCE)

Retrieves and returns the "name part" of the script name of RESOURCE, i.e. the last non-empty string behind a slash. Note that the result can be NIL. This is a bit similar to CL:FILE-NAMESTRING.

RETRIEVE-PROPERTIES (KEY)

Retrieves the properties stored under the (EQUAL) key KEY.

SPEC (NODE)

Returns the corresponding "spec" from +WEBDAV-DTD+ if NODE is a DAV node in XMLS format.

STARTS-WITH-P (SEQ PREFIX &KEY (TEST #'CHAR=))

Returns a true value if the sequence SEQ starts with the sequence PREFIX whereby the elements are compared using TEST.

STATUS-LINE (RETURN-CODE)

Returns a full HTTP/1.1 status line corresponding to the return code RETURN-CODE.

STORE-PROPERTIES (KEY PROPERTIES)

Stores PROPERTIES under the (EQUAL) key KEY.

URL-DECODE* (STRING)

Tries to URL-decode STRING with the UTF-8 external format first and then uses LATIN-1 if that fails.

WALK-XMLS-NODE (HANDLER XMLS-NODE)

Helper function for SERIALIZE-XMLS-NODE. Walks recursively through the XMLS node XMLS-NODE and calls the SAX handler HANDLER when appropriate.

WHITESPACE-STRING-P (THING)

Returns a true value if THING is a string consisting solely of whitespace.

Undocumented

ROD (X)

MACRO

Private

DEFCONSTANT (NAME VALUE &OPTIONAL DOC)

Make sure VALUE is evaluated only once (to appease SBCL).

DEFINE-RETURN-CODE-SHORTCUT (NAME RETURN-CODE)

Defines a function called NAME which just sets the HTTP return code to RETURN-CODE and then ends the current handler by calling ABORT-REQUEST-HANDLER.

GENERIC-FUNCTION

Public

ACCEPT-REQUEST-P (RESOURCE-CLASS REQUEST)

This must be a function which accepts a Hunchentoot request object REQUEST and returns a generalized boolean denoting whether REQUEST denotes a resource the DAV server wants to handle. Usually, you'll want to look at the script name of the request or something like that - see the class FILE-RESOURCE for an example. Note that you specialize this function on the resource /class/ and not on the resource.

COPY-DEAD-PROPERTIES (SOURCE DESTINATION)

This function must copy all dead properties of the resource SOURCE to the resource DESTINATION. There's a default method but you should definitely specialize this for production servers.

COPY-RESOURCE (SOURCE DESTINATION)

This function must "copy" the (contents of the) resource SOURCE in such a way that the copy can in the future be accessed as DESTINATION. It doesn't have to deal with dead properties, and it can assume that SOURCE doesn't have children in case it's a collection.

CREATE-COLLECTION (RESOURCE)

This function must create a collection resource that in the future can be accessed as RESOURCE.

CREATE-DAV-DISPATCHER (RESOURCE-CLASS &OPTIONAL MS-WORKAROUND-P)

Creates and returns a dispatcher for the class RESOURCE-CLASS which must be a subclass of RESOURCE. If MS-WORKAROUND-P is true (which is the default), OPTIONS requests are always handled irrespective of the results of ACCEPT-REQUEST-P - this is needed to work around problems with some Microsoft DAV clients.

FILE-RESOURCE-BASE-PATH-NAMESTRING (RESOURCE-CLASS)

This generic function is called for subclasses of FILE-RESOURCE to determine the base pathname that's currently being used, i.e. the part of the filesystem where the files served by the DAV server are stored. The function must return the namestring of the truename of an absolute pathname denoting a directory, specifically it must return a string starting and ending with slashes. (Note: This should work on Windows as well.) You can specialize this function (either on the class or on the name of the class) if you want. The default method returns the current value of *FILE-RESOURCE-BASE-PATH-NAMESTRING*.

FILE-RESOURCE-BASE-URI (RESOURCE-CLASS)

This generic function is called for subclasses of FILE-RESOURCE to determine the base URI that's currently being used, i.e. the prefix the script name of a resource's URI must have in order to be valid. (In other words: this URI represents the top-level collection of the DAV server.) The function must return a string which starts with a slash and does /not/ end with a slash and is correctly URL-encoded. You can specialize this function (either on the class or on the name of the class) if you want. The default method returns the current value of *FILE-RESOURCE-BASE-URI*.

GET-CONTENT (RESOURCE STREAM LENGTH)

This function is called for PUT requests and must read LENGTH octets of data from the (flexi) stream STREAM and store them in a place appropriate for the resource RESOURCE.

GET-DEAD-PROPERTIES (RESOURCE)

This function must return all dead properties of the resource RESOURCE as a list of XML elements structured as XMLS nodes. There's a default method but you should definitely specialize this for production servers.

MOVE-DEAD-PROPERTIES (SOURCE DESTINATION)

This function must move all dead properties of the resource SOURCE to the resource DESTINATION. There's a default method but you should definitely specialize this for production servers.

MOVE-RESOURCE (SOURCE DESTINATION)

This function must "move" the (contents of the) resource SOURCE in such a way that it can in the future be accessed as DESTINATION. It doesn't have to deal with dead properties, and it can assume that SOURCE doesn't have children in case it's a collection.

REMOVE-DEAD-PROPERTIES (RESOURCE)

This function must remove all dead properties of the resource RESOURCE. There's a default method but you should definitely specialize this for production servers.

REMOVE-DEAD-PROPERTY (RESOURCE PROPERTY)

This function must remove the currently stored dead property designated by PROPERTY (an XMLS node) of the resource RESOURCE. There's a default method but you should definitely specialize this for production servers.

REMOVE-RESOURCE (RESOURCE)

This function must completely remove the resource RESOURCE. It doesn't have to deal with dead properties, and it can assume that RESOURCE doesn't have children in case it's a collection.

RESOURCE-CHILDREN (RESOURCE)

This function must return a list of all children of RESOURCE (which themselves are RESOURCE objects). You must specialize this generic function for your own classes.

RESOURCE-COLLECTION-P (RESOURCE)

This function must return a true value if the resource RESOURCE is a collection. You must specialize this generic function for your own classes.

RESOURCE-CONTENT-LANGUAGE (RESOURCE)

This function should return either NIL or a language tag as defined in section 14.13 of RFC 2068. If the value returned by this function is not NIL, it will also be used as the `Content-Language' header returned for GET requests. There's a default method which always returns NIL.

RESOURCE-CONTENT-TYPE (RESOURCE)

This function must return a string denoting the MIME type of the resource RESOURCE. It will only be called if RESOURCE is /not/ a collection. There's a default method which always returns "application/octet-stream", but most likely you'll want to specialize this for your own classes.

RESOURCE-CREATION-DATE (RESOURCE)

This function must return a universal time denoting the time the resource RESOURCE was created. There's a default method which returns RESOURCE-WRITE-DATE, but most likely you'll want to specialize this for you own classes.

RESOURCE-DISPLAY-NAME (RESOURCE)

This function must return a string which, according to the WebDAV RFC, "provides a name for the resource that is suitable for presentation to a user." You must specialize this generic function for your own classes.

RESOURCE-ETAG (RESOURCE)

This function should return an ETag for the resource RESOURCE or NIL. If the value returned by this function is not NIL, it will also be used as the `ETag' header returned for GET requests. There's a default method which synthesizes a value based on the script name and the write date of the resource, and in most cases you probably don't need to specialize this function.

RESOURCE-EXISTS (RESOURCE)

This function must return a true value if the resource RESOURCE exists on the server and NIL otherwise. You must specialize this generic function for your own classes.

RESOURCE-LENGTH (RESOURCE)

This function must return an integer denoting the length of the resource RESOURCE in octets. You must specialize this generic function for your own classes.

RESOURCE-PARENT (RESOURCE)

This function must return a RESOURCE object which is the parent resource of RESOURCE or NIL if there is no parent. You must specialize this generic function for your own classes.

RESOURCE-SOURCE (RESOURCE)

This function should return either NIL or a DAV "source" XML node (structured as an XMLS node) that, according to the WebDAV RFC, "identifies the resource that contains the unprocessed source of the link's source." There's a default method which always returns NIL.

RESOURCE-TYPE (RESOURCE)

This function should return either NIL or a DAV "resourcetype" XML node (structured as an XMLS node) that, according to the WebDAV RFC, "specifies the nature of the resource." There's a default method which returns something fitting for collections and NIL otherwise, and in most cases you probably don't need to specialize this function.

RESOURCE-URI-PREFIX (RESOURCE)

This function must return a string which is the part of a resource's HTTP or HTTPS URI that comprises the scheme, the host, and the port and ends with a slash - something like "http://localhost:4242/" or "https://www.lisp.org/". The default method synthesizes this from the information Hunchentoot provides and usually you only have to write your own method if you're sitting behind a proxy.

RESOURCE-WRITE-DATE (RESOURCE)

This function must return a universal time denoting the time the resource RESOURCE was last modified. You must specialize this generic function for your own classes.

SEND-CONTENT (RESOURCE STREAM)

This function is called for GET requests and must send the complete contents of the (non-collection) resource RESOURCE to the (flexi) stream STREAM.

SET-DEAD-PROPERTY (RESOURCE PROPERTY)

This function must replace the currently stored dead property designated by PROPERTY (an XMLS node) of the resource RESOURCE with PROPERTY, i.e. PROPERTY doubles as the property itself and as the property designator. There's a default method but you should definitely specialize this for production servers.

Private

CREATE-RESOURCE (RESOURCE-CLASS SCRIPT-NAME)

Creates and returns an object of type RESOURCE-CLASS (a subclass of RESOURCE) corresponding to the script name SCRIPT-NAME (which is already URL-decoded).

VALIDATE (NODE SPEC POS)

Validates the node NODE against the spec (see function SPEC) SPEC. SPEC can be a string (denoting the local name of a DAV node), one of the symbols :ANY, :EMPTY, or :PCDATA, a two element list beginning with * or ?, a list beginning with :CHOICE, or any other list denoting a sequence. If POS is NIL, SPEC must be a string and the node itself is validated to conform to SPEC and a true value is returned iff that's the case. Otherwise, POS should be a non-negative integer N, and the Nth child of NODE will be validated. The true value returned in this case (i.e. if the Nth child is valid) will be another integer denoting the next child which has to be validated. Furthermore, whitespace is removed from elements which can only have element content.

SLOT-ACCESSOR

Public

RESOURCE-SCRIPT-NAME (OBJECT)

This slot holds the script name (see HUNCHENTOOT:SCRIPT-NAME) that was used to create the resource. For objects you create yourself, you must provide a meaningful value that can be used to access the resource.

SETFRESOURCE-SCRIPT-NAME (NEW-VALUE OBJECT)

This slot holds the script name (see HUNCHENTOOT:SCRIPT-NAME) that was used to create the resource. For objects you create yourself, you must provide a meaningful value that can be used to access the resource.

Private

ELEMENT-STACK (OBJECT)

Used to keep track of the stack of "open" (encountered SAX:START-ELEMENT, but didn't see SAX:END-ELEMENT yet) elements.

SETFELEMENT-STACK (NEW-VALUE OBJECT)

Used to keep track of the stack of "open" (encountered SAX:START-ELEMENT, but didn't see SAX:END-ELEMENT yet) elements.

REAL-PATH (OBJECT)

The pathname of the resource within the local file system.

SETFREAL-PATH (NEW-VALUE OBJECT)

The pathname of the resource within the local file system.

ROOT (OBJECT)

The root of the XML document.

SETFROOT (NEW-VALUE OBJECT)

The root of the XML document.

VARIABLE

Public

*ALLOWED-METHODS*

The list of methods (as keywords) returned by the `Allow' header in case of OPTIONS requests (and also utilized by the handler for MKCOL). Can be adapted to allow for more methods, but for a WebDAV server at least the methods above should be listed.

*DAV-COMPLIANCE-CLASSES*

A /sorted/ list of DAV compliance classes reported in the `DAV' header when answering OPTIONS requests. It doesn't make much sense to have more then class 1 in here as long as there's no lock support.

*FILE-RESOURCE-BASE-PATH-NAMESTRING*

The value of this variable is the return value of the default method for FILE-RESOURCE-BASE-PATH-NAMESTRING. It should be the namestring of the truename of an absolute pathname denoting a directory, specifically it must return a string starting and ending with slashes. (Note: This should work on Windows as well.)

*FILE-RESOURCE-BASE-URI*

The value of this variable is the return value of the default method for FILE-RESOURCE-BASE-URI. It should be a string which starts with a slash if it's not empty and does /not/ end with a slash and is /not/ URL-encoded.

*RESOURCE-CLASS*

Whenever a DAV handler is executed, this variable should be bound to the resource class which is to be used. If you're using CREATE-DAV-DISPATCHER, this will already be taken care of for you.

Private

*PROPERTY-HASH*

The hash table that by default is used to store dead properties in RAM.

CLASS

Public

AUTHORIZED-FILE-RESOURCE

A subclass of FILE-RESOURCE representing file resources which are associated with a certain user.

FILE-RESOURCE

A subclass of RESOURCE representing resources which are mapped to a subtree of the local file system.

RESOURCE

This is the base class you'll have to subclass if you want to create your own custom DAV server. Each object of this class represents one resource on the server and most of the time these objects are created by the server using only the :SCRIPT-NAME initarg. If you need more initialization to happen, write an :AFTER method for INITIALIZE-INSTANCE. See the file `file-resources.lisp' for an example of a subclass of RESOURCE.

Private

XMLS-BUILDER

This is like CXML's XMLS-BUILDER class, but without attempting to be compatible with XMLS, so we can get namespaces right.

CONSTANT

Private

+BUFFER-LENGTH+

Length of buffers used for internal purposes.

+DAV-PROPERTY-ALIST+

An alist mapping the (names of the) standard DAV properties to functions handling them.

+DAV-PROPERTY-DESIGNATORS+

A list of XMLS nodes which are property designators for all DAV (live) properties defined by the WebDAV RFC. Computed at load time from +DAV-PROPERTY-ALIST+.

+LATIN-1+

A FLEXI-STREAMS external format for ISO-8859-1.

+UTF-8+

A FLEXI-STREAMS external format for UTF-8.

+WEBDAV-DTD+

This is used to validate incoming XML. Obviously, this is not a "real" DTD, but the idea should be clear.