This is the cl-webdav Reference Manual, version 0.2.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:36:53 2024 GMT+0.
cl-webdav/cl-webdav.asd
cl-webdav/packages.lisp
cl-webdav/specials.lisp
cl-webdav/util.lisp
cl-webdav/xml.lisp
cl-webdav/resources.lisp
cl-webdav/properties.lisp
cl-webdav/handlers.lisp
cl-webdav/file-resources.lisp
cl-webdav/authorized-file-resources.lisp
The main system appears first, followed by any subsystem dependency.
cl-webdav
A WebDAV server written in Common Lisp
0.2.1
hunchentoot
(system).
cxml
(system).
cl-fad
(system).
packages.lisp
(file).
specials.lisp
(file).
util.lisp
(file).
xml.lisp
(file).
resources.lisp
(file).
properties.lisp
(file).
handlers.lisp
(file).
file-resources.lisp
(file).
authorized-file-resources.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-webdav/cl-webdav.asd
cl-webdav/packages.lisp
cl-webdav/specials.lisp
cl-webdav/util.lisp
cl-webdav/xml.lisp
cl-webdav/resources.lisp
cl-webdav/properties.lisp
cl-webdav/handlers.lisp
cl-webdav/file-resources.lisp
cl-webdav/authorized-file-resources.lisp
cl-webdav/specials.lisp
packages.lisp
(file).
cl-webdav
(system).
*allowed-methods*
(special variable).
*dav-compliance-classes*
(special variable).
*file-resource-base-path-namestring*
(special variable).
*file-resource-base-uri*
(special variable).
*resource-class*
(special variable).
*property-hash*
(special variable).
+buffer-length+
(constant).
+dav-property-alist+
(constant).
+latin-1+
(constant).
+utf-8+
(constant).
+webdav-dtd+
(constant).
constantly-nil
(function).
defconstant
(macro).
cl-webdav/util.lisp
specials.lisp
(file).
cl-webdav
(system).
bad-gateway
(function).
conflict
(function).
define-return-code-shortcut
(macro).
failed-dependency
(function).
forbidden
(function).
iso-8601-date
(function).
md5-hex
(function).
method-not-allowed
(function).
not-found
(function).
not-implemented
(function).
precondition-failed
(function).
starts-with-p
(function).
status-line
(function).
url-decode*
(function).
whitespace-string-p
(function).
cl-webdav/xml.lisp
util.lisp
(file).
cl-webdav
(system).
characters
(method).
dav-node
(function).
end-document
(method).
end-element
(method).
local-name
(function).
namespace-uri
(function).
node-attributes
(function).
(setf node-attributes)
(function).
node-children
(function).
(setf node-children)
(function).
parse-dav
(function).
serialize-xmls-node
(function).
start-element
(method).
xmls-node-p
(function).
element-stack
(reader method).
(setf element-stack)
(writer method).
ignore-non-dav-elements
(function).
make-xmls-builder
(function).
make-xmls-node
(function).
remove-content
(function).
root
(reader method).
(setf root)
(writer method).
spec
(function).
validate
(generic function).
walk-xmls-node
(function).
xmls-builder
(class).
cl-webdav/resources.lisp
xml.lisp
(file).
cl-webdav
(system).
accept-request-p
(generic function).
copy-dead-properties
(generic function).
copy-resource
(generic function).
create-collection
(generic function).
get-content
(generic function).
get-dead-properties
(generic function).
move-dead-properties
(generic function).
move-resource
(generic function).
remove-dead-properties
(generic function).
remove-dead-property
(generic function).
remove-resource
(generic function).
resource
(class).
resource-children
(generic function).
resource-collection-p
(generic function).
resource-content-language
(generic function).
resource-content-type
(generic function).
resource-creation-date
(generic function).
resource-display-name
(generic function).
resource-etag
(generic function).
resource-exists
(generic function).
resource-length
(generic function).
resource-parent
(generic function).
resource-script-name
(reader method).
(setf resource-script-name)
(writer method).
resource-source
(generic function).
resource-type
(generic function).
resource-uri-prefix
(generic function).
resource-write-date
(generic function).
send-content
(generic function).
set-dead-property
(generic function).
copy-or-move-resource*
(function).
create-resource
(generic function).
creation-date
(function).
get-content-length
(function).
get-content-type
(function).
get-last-modified
(function).
get-resource
(function).
remove-resource*
(function).
resource-created
(function).
resource-href
(function).
resource-name
(function).
cl-webdav/properties.lisp
resources.lisp
(file).
cl-webdav
(system).
+dav-property-designators+
(constant).
all-dead-property-designators
(function).
all-property-designators
(function).
collect-properties
(function).
copy-properties
(function).
dav-property-function
(function).
get-dead-property
(function).
get-property
(function).
move-properties
(function).
parse-propfind
(function).
property-equal
(function).
propstat
(function).
remove-properties
(function).
retrieve-properties
(function).
store-properties
(function).
cl-webdav/handlers.lisp
properties.lisp
(file).
cl-webdav
(system).
create-dav-dispatcher
(generic function).
options-dispatcher
(function).
options-handler
(function).
copy-handler
(function).
dav-dispatcher
(function).
delete-handler
(function).
get-handler
(function).
head-handler
(function).
mkcol-handler
(function).
move-handler
(function).
multi-status
(function).
propfind-handler
(function).
proppatch-handler
(function).
put-handler
(function).
cl-webdav/file-resources.lisp
handlers.lisp
(file).
cl-webdav
(system).
accept-request-p
(method).
copy-dead-properties
(method).
copy-resource
(method).
create-collection
(method).
file-resource
(class).
file-resource-base-path-namestring
(generic function).
file-resource-base-uri
(generic function).
get-content
(method).
get-dead-properties
(method).
initialize-instance
(method).
move-dead-properties
(method).
move-resource
(method).
remove-dead-properties
(method).
remove-dead-property
(method).
remove-resource
(method).
resource-children
(method).
resource-collection-p
(method).
resource-content-type
(method).
resource-display-name
(method).
resource-exists
(method).
resource-length
(method).
resource-parent
(method).
resource-write-date
(method).
send-content
(method).
set-dead-property
(method).
compute-real-path
(function).
real-path
(reader method).
(setf real-path)
(writer method).
cl-webdav/authorized-file-resources.lisp
file-resources.lisp
(file).
cl-webdav
(system).
accept-request-p
(method).
authorized-file-resource
(class).
create-dav-dispatcher
(method).
file-resource-base-path-namestring
(method).
Packages are listed by definition order.
cl-webdav
dav
common-lisp
.
cxml
.
hunchentoot
.
*allowed-methods*
(special variable).
*dav-compliance-classes*
(special variable).
*file-resource-base-path-namestring*
(special variable).
*file-resource-base-uri*
(special variable).
*resource-class*
(special variable).
accept-request-p
(generic function).
authorized-file-resource
(class).
copy-dead-properties
(generic function).
copy-resource
(generic function).
create-collection
(generic function).
create-dav-dispatcher
(generic function).
dav-node
(function).
file-resource
(class).
file-resource-base-path-namestring
(generic function).
file-resource-base-uri
(generic function).
get-content
(generic function).
get-dead-properties
(generic function).
local-name
(function).
move-dead-properties
(generic function).
move-resource
(generic function).
namespace-uri
(function).
node-attributes
(function).
(setf node-attributes)
(function).
node-children
(function).
(setf node-children)
(function).
options-dispatcher
(function).
options-handler
(function).
parse-dav
(function).
remove-dead-properties
(generic function).
remove-dead-property
(generic function).
remove-resource
(generic function).
resource
(class).
resource-children
(generic function).
resource-collection-p
(generic function).
resource-content-language
(generic function).
resource-content-type
(generic function).
resource-creation-date
(generic function).
resource-display-name
(generic function).
resource-etag
(generic function).
resource-exists
(generic function).
resource-length
(generic function).
resource-parent
(generic function).
resource-script-name
(generic reader).
(setf resource-script-name)
(generic writer).
resource-source
(generic function).
resource-type
(generic function).
resource-uri-prefix
(generic function).
resource-write-date
(generic function).
send-content
(generic function).
serialize-xmls-node
(function).
set-dead-property
(generic function).
xmls-node-p
(function).
*property-hash*
(special variable).
+buffer-length+
(constant).
+dav-property-alist+
(constant).
+dav-property-designators+
(constant).
+latin-1+
(constant).
+utf-8+
(constant).
+webdav-dtd+
(constant).
all-dead-property-designators
(function).
all-property-designators
(function).
bad-gateway
(function).
collect-properties
(function).
compute-real-path
(function).
conflict
(function).
constantly-nil
(function).
copy-handler
(function).
copy-or-move-resource*
(function).
copy-properties
(function).
create-resource
(generic function).
creation-date
(function).
dav-dispatcher
(function).
dav-property-function
(function).
defconstant
(macro).
define-return-code-shortcut
(macro).
delete-handler
(function).
element-stack
(generic reader).
(setf element-stack)
(generic writer).
failed-dependency
(function).
forbidden
(function).
get-content-length
(function).
get-content-type
(function).
get-dead-property
(function).
get-handler
(function).
get-last-modified
(function).
get-property
(function).
get-resource
(function).
head-handler
(function).
ignore-non-dav-elements
(function).
iso-8601-date
(function).
make-xmls-builder
(function).
make-xmls-node
(function).
md5-hex
(function).
method-not-allowed
(function).
mkcol-handler
(function).
move-handler
(function).
move-properties
(function).
multi-status
(function).
not-found
(function).
not-implemented
(function).
parse-propfind
(function).
precondition-failed
(function).
property-equal
(function).
propfind-handler
(function).
proppatch-handler
(function).
propstat
(function).
put-handler
(function).
real-path
(generic reader).
(setf real-path)
(generic writer).
remove-content
(function).
remove-properties
(function).
remove-resource*
(function).
resource-created
(function).
resource-href
(function).
resource-name
(function).
retrieve-properties
(function).
root
(generic reader).
(setf root)
(generic writer).
spec
(function).
starts-with-p
(function).
status-line
(function).
store-properties
(function).
url-decode*
(function).
validate
(generic function).
walk-xmls-node
(function).
whitespace-string-p
(function).
xmls-builder
(class).
Definitions are sorted by export status, category, package, and then by lexicographic order.
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.
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.
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.)
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.
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.
Shortcut for MAKE-XMLS-NODE. Returns an XMLS node with the local name LOCAL-NAME, the namespace URI "DAV:", and the children CHILDREN.
Returns the local name of the XMLS node or attribute THING.
Returns the namespace URI (which can be NIL) of the XMLS node or attribute THING.
Returns the list of attributes of the XMLS node XMLS-NODE.
Sets the list of attributes of the XMLS node XMLS-NODE to ATTRIBUTES.
Returns the list of children of the XMLS node XMLS-NODE.
Sets the list of children of the XMLS node XMLS-NODE to CHILDREN.
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...
The handler for OPTIONS requests. Output is basically determined by *ALLOWED-METHODS* and *DAV-COMPLIANCE-CLASSES*.
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.
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.
Checks whether THING is an XMLS node. See the docstring of MAKE-XMLS-NODE for a description of the structure of XMLS nodes.
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.
(eql cl-webdav:authorized-file-resource)
) request) ¶We just use the method for FILE-RESOURCE.
(eql cl-webdav:file-resource)
) request) ¶A request is accepted if it starts with the base URI.
standard-class
) script-name) ¶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.
file-resource
) (destination file-resource
)) ¶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.
file-resource
) (destination file-resource
)) ¶A file resource is moved by copying its counterpart in the file system (using CL-FAD’s function COPY-FILE). Collections (directories) are "copied" simply by creating a new directory with the same name in the destination location.
This function must create a collection
resource that in the future can be accessed as RESOURCE.
A collection is created by creating the corresponding directory in the file system (using the Common Lisp function ENSURE-DIRECTORIES-EXIST.
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.
(eql cl-webdav:authorized-file-resource)
) &optional ms-workaround-p) ¶This :AROUND method wraps the normal DAV dispatcher with one that checks basic HTTP authentication first.
standard-class
) &optional ms-workaround-p) ¶symbol
) &optional ms-workaround-p) ¶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*.
(eql cl-webdav:authorized-file-resource)
)) ¶We compute the base path by attaching the downcased user name to the base path returned for plain file resources. We also create the directory if necessary.
standard-class
)) ¶symbol
)) ¶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*.
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.
file-resource
) stream length) ¶To implement this method, we simply open the corresponding file for writing and read its contents (as chunks of octets) from the stream.
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.
file-resource
)) ¶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.
file-resource
) (destination file-resource
)) ¶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.
file-resource
) (destination file-resource
)) ¶A file resource is moved by moving its counterpart in the file system (using the Common Lisp function RENAME-FILE).
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.
file-resource
)) ¶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.
file-resource
) property) ¶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.
file-resource
)) ¶A file resource is removed by removing the corresponding file in the file system.
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.
file-resource
)) ¶The children of a (collection) file resource are the contents of the corresponding directory in the file system.
This function must return a true value if the
resource RESOURCE is a collection. You must specialize this
generic function for your own classes.
file-resource
)) ¶A file resource is a collection iff the corresponding file is a directory.
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.
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.
file-resource
)) ¶We use Hunchentoot’s MIME-TYPE function to determine the resource’s content type based on the type component of its pathname.
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.
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.
file-resource
)) ¶The display name is basically the real path with the base path stripped off. But we also make sure to convert Windows backslashes to Unix slashes.
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.
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.
file-resource
)) ¶A file resource exists iff the corresponding file exists.
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.
file-resource
)) ¶The length of a file resource is the length of the corresponding file in octets.
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.
file-resource
)) ¶To determine the parent of a file resource we "walk up" the script name and map the result to a pathname in the file system.
resource
)) ¶resource
)) ¶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.
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.
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.
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.
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.
file-resource
)) ¶As the write date of a resource we return the write date of the corresponding file (or the current time in case we can’t determine the file’s write date).
This function is called for GET requests and
must send the complete contents of the (non-collection) resource
RESOURCE to the (flexi) stream STREAM.
file-resource
) stream) ¶To implement this method, we simply open the corresponding file for reading and send its contents (as chunks of octets) to the stream.
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.
file-resource
) property) ¶xmls-builder
) data) ¶The method to be called when the SAX parser encounters character content.
sax
.
xmls-builder
)) ¶The last method to be called when parsing an XML document - returns the root of the document.
sax
.
xmls-builder
) namespace-uri local-name qname) ¶The method to be called when the SAX parser encounters the end of an element.
sax
.
file-resource
) &rest initargs) ¶When a file resource is created, either the real path or the script name is known. This :AFTER method sets the other slot.
xmls-builder
) namespace-uri local-name qname attributes) ¶The method to be called when the SAX parser encounters the start of an element.
sax
.
A subclass of FILE-RESOURCE representing file resources which are associated with a certain user.
A subclass of RESOURCE representing resources
which are mapped to a subtree of the local file system.
copy-dead-properties
.
copy-resource
.
get-content
.
get-dead-properties
.
initialize-instance
.
move-dead-properties
.
move-resource
.
(setf real-path)
.
real-path
.
remove-dead-properties
.
remove-dead-property
.
remove-resource
.
resource-children
.
resource-collection-p
.
resource-content-type
.
resource-display-name
.
resource-exists
.
resource-length
.
resource-parent
.
resource-write-date
.
send-content
.
set-dead-property
.
The pathname of the resource within the local file system.
:real-path
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.
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.
hunchentoot
.
:script-name
Length of buffers used for internal purposes.
An alist mapping the (names of the) standard DAV properties to functions handling them.
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+.
A FLEXI-STREAMS external format for ISO-8859-1.
A FLEXI-STREAMS external format for UTF-8.
This is used to validate incoming XML. Obviously, this is not a "real" DTD, but the idea should be clear.
The hash table that by default is used to store dead properties in RAM.
Make sure VALUE is evaluated only once (to appease SBCL).
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.
Returns a list of XMLS nodes which are designators for all dead properties for the resource RESOURCE.
Returns a list of XMLS nodes which are designators for all (dead and live) properties for the resource RESOURCE.
Sets RETURN-CODE to +HTTP-BAD-GATEWAY+ and then calls ABORT-REQUEST-HANDLER.
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.
Computes the "real path" of a file resource from the request’s script name.
Sets RETURN-CODE to +HTTP-CONFLICT+ and then calls ABORT-REQUEST-HANDLER.
Does the same as the result of (CONSTANTLY NIL).
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.
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.
Copies (using COPY-TREE) properties stored under the (EQUAL) key FROM-KEY (if any) to the key TO-KEY.
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.
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.
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.
The handler for DELETE requests. Uses REMOVE-RESOURCE* to do the actual work.
Sets RETURN-CODE to +HTTP-FAILED-DEPENDENCY+ and then calls ABORT-REQUEST-HANDLER.
Sets RETURN-CODE to +HTTP-FORBIDDEN+ and then calls ABORT-REQUEST-HANDLER.
This is the function that is called for the "getcontentlength" property. It simply returns the result of RESOURCE-LENGTH as a string.
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.
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.
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.
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.
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.
Creates and returns an object of the type stored in *RESOURCE-CLASS* corresponding to the script name SCRIPT-NAME.
The handler for HEAD requests - the actual work is done by GET-HANDLER.
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).
Returns a string representing the universal time UNIVERSAL-TIME as an ISO-8601-formatted date.
Creates and returns an instance of the XMLS-BUILDER class.
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.
Calculates the md5 sum of the string STRING and returns it as a hex string.
Sets RETURN-CODE to +HTTP-METHOD-NOT-ALLOWED+ and then calls ABORT-REQUEST-HANDLER.
The handler for MKCOL requests which uses CREATE-COLLECTION internally.
The handler for MOVE requests. Calls COPY-HANDLER to do the actual work.
Moves properties stored under the (EQUAL) key FROM-KEY (if any) to the key TO-KEY.
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.
Sets RETURN-CODE to +HTTP-NOT-FOUND+ and then calls ABORT-REQUEST-HANDLER.
Sets RETURN-CODE to +HTTP-NOT-IMPLEMENTED+ and then calls ABORT-REQUEST-HANDLER.
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.
Sets RETURN-CODE to +HTTP-PRECONDITION-FAILED+ and then calls ABORT-REQUEST-HANDLER.
Two (XMLS nodes denoting) properties are equal iff they have the same local name and the same namespace URI.
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.
The handler for PROPPATCH requests. Parses the request’s content body, modifies the dead properties as specified and returns a corresponding "multistatus" XML element.
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.
The handler for PUT requests. Uses GET-CONTENT to create a new resource from the contents sent by the client.
Returns an XMLS node which has the same name and attributes as the XMLS node XMLS-NODE but an empty body.
Removes any properties stored under the (EQUAL) key KEY.
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.
Utility function which sets up Hunchentoot’s *REPLY* object for a +HTTP-CREATED+ response corresponding to the newly-created resource RESOURCE.
Returns a URL-encoded version of the resource’s script name for use in HREF elements in property XML.
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.
Retrieves the properties stored under the (EQUAL) key KEY.
Returns the corresponding "spec" from +WEBDAV-DTD+ if NODE is a DAV node in XMLS format.
Returns a true value if the sequence SEQ starts with the sequence PREFIX whereby the elements are compared using TEST.
Returns a full HTTP/1.1 status line corresponding to the return code RETURN-CODE.
Stores PROPERTIES under the (EQUAL) key KEY.
Tries to URL-decode STRING with the UTF-8 external format first and then uses LATIN-1 if that fails.
Helper function for SERIALIZE-XMLS-NODE. Walks recursively through the XMLS node XMLS-NODE and calls the SAX handler HANDLER when appropriate.
Returns a true value if THING is a string consisting solely of whitespace.
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).
xmls-builder
)) ¶xmls-builder
)) ¶Used to keep track of the stack
of "open" (encountered SAX:START-ELEMENT, but didn’t see
SAX:END-ELEMENT yet) elements.
file-resource
)) ¶file-resource
)) ¶The pathname of the resource within the local file system.
xmls-builder
)) ¶xmls-builder
)) ¶The root of the XML document.
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.
list
) pos) ¶Compound validation for choices, repetitions, and sequences - dispatces on the first element of SPEC.
(eql :pcdata)
) pos) ¶Succeeds (and this increments POS by 1) if the child at position POS is not an XMLS node (i.e. if it’s character data).
(eql :empty)
) pos) ¶Succeeds (with a return value of 1) iff there are no children.
(eql :any)
) pos) ¶Always succeeds and eats up all remaining children of NODE.
string
) pos) ¶Validates NODE or the child at position POS to conform to the spec for the DAV node named SPEC.
This is like CXML’s XMLS-BUILDER class, but
without attempting to be compatible with XMLS, so we can get
namespaces right.
default-handler
.
Used to keep track of the stack
of "open" (encountered SAX:START-ELEMENT, but didn’t see
SAX:END-ELEMENT yet) elements.
Jump to: | (
A B C D E F G H I L M N O P R S U V W X |
---|
Jump to: | (
A B C D E F G H I L M N O P R S U V W X |
---|
Jump to: | *
+
C E R S |
---|
Jump to: | *
+
C E R S |
---|
Jump to: | A C F H P R S U X |
---|
Jump to: | A C F H P R S U X |
---|