From 2327bef57f8b3cc0393dd8dfbd42b16709886c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20H=C3=BC=C3=9Fler?= Date: Fri, 20 May 2022 23:49:10 +0200 Subject: [PATCH] gcoap/fileserver: update documentation --- sys/include/net/gcoap/fileserver.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sys/include/net/gcoap/fileserver.h b/sys/include/net/gcoap/fileserver.h index eb1475a85d..5a874f9785 100644 --- a/sys/include/net/gcoap/fileserver.h +++ b/sys/include/net/gcoap/fileserver.h @@ -16,13 +16,18 @@ * This maps files in the local file system onto a resources in CoAP. In that, * it is what is called a static web server in the unconstrained web. * - * As usual, GET operations are used to read files. + * that files are not updated atomically, although files are created atomically. + * The Content-Format option is not checked in the current implementation. + * Conditional file modification and deletion is supported using the If-Match + * option. The If-Match option carries a previously received Etag or in case of + * zero length, requires a request to be processed only if the resource exists. + * In opposite, the If-None-Match option requires a request to be processed, + * only if the resource does not yet exist, and is most useful for file creation. * - * Directories are expressed to URIs with trailing slashes. + * Directories are expressed to URIs with trailing slashes and can be DELETEd + * when empty. * * @note The file server uses ETag for cache validation. The ETags are built * from the file system stat values. As clients rely on the ETag to differ when @@ -55,8 +60,8 @@ * The path argument specifies under which path the folder is served via CoAP while * the context argument contains the path on the local filesystem that will be served. * - * The allowed methods dictate whether it's read-only (``COAP_GET``) or (in the - * future) read-write (``COAP_GET | COAP_PUT | COAP_DELETE``). + * The allowed methods dictate whether it's read-only (``COAP_GET``) or + * read-write (``COAP_GET | COAP_PUT | COAP_DELETE``). * * @{ *