Liking cljdoc? Tell your friends :D

dk.simongray.webdav.paths

The paths of resources below the root of a share, and the hrefs that name them.

A path is a vector of decoded segments below the root, e.g. ["notes" "a b.edn"], and [] is the root itself. Each segment is in Unicode's normalization form C, so that café names one resource however a client writes it. An href is an absolute path with each segment percent-encoded, as RFC 4918, section 8.3, allows, e.g. /dav/notes/a%20b.edn. The percent-encoding is whatwg-url's, so it's the same on every platform.

The paths of resources below the root of a share, and the hrefs that
name them.

A path is a vector of decoded segments below the root, e.g. ["notes"
"a b.edn"], and [] is the root itself. Each segment is in Unicode's
normalization form C, so that café names one resource however a client
writes it. An href is an absolute path with each segment
percent-encoded, as RFC 4918, section 8.3, allows, e.g.
/dav/notes/a%20b.edn. The percent-encoding is whatwg-url's, so it's the
same on every platform.
raw docstring

hrefclj/s

(href root path)
(href root path collection?)

The href of the path below the root of a share, with a trailing slash when it's a collection?. A segment that can't name a resource (see segment?), e.g. .., throws.

(href "/dav/" ["notes" "a b.edn"])
;; => "/dav/notes/a%20b.edn"
The href of the `path` below the `root` of a share, with a trailing
slash when it's a `collection?`. A segment that can't name a resource
(see segment?), e.g. .., throws.

    (href "/dav/" ["notes" "a b.edn"])
    ;; => "/dav/notes/a%20b.edn"
sourceraw docstring

nameclj/s

(name href)

The decoded last segment of the href, a URL or a path, e.g. a b.edn for /dav/notes/a%20b.edn. It's empty for the root of a server.

The decoded last segment of the `href`, a URL or a path, e.g. a b.edn
for /dav/notes/a%20b.edn. It's empty for the root of a server.
sourceraw docstring

parentclj/s

(parent path)

The path of the collection that holds the resource at path, or nil for the root.

The path of the collection that holds the resource at `path`, or nil
for the root.
sourceraw docstring

parseclj/s

(parse root s)

The path of the percent-encoded absolute path s, e.g. the :uri of a Ring request, below the root of a share. It's nil when s isn't below the root, and :invalid when a segment can't name a resource (see segment?). The root matches by its decoded segments, so that e.g. /simon%40example.com/ is below the root /simon@example.com/ too.

(parse "/dav/" "/dav/notes/a%20b.edn")
;; => ["notes" "a b.edn"]
The path of the percent-encoded absolute path `s`, e.g. the :uri of a
Ring request, below the `root` of a share. It's nil when `s` isn't below
the root, and :invalid when a segment can't name a resource (see
segment?). The root matches by its decoded segments, so that e.g.
/simon%40example.com/ is below the root /simon@example.com/ too.

    (parse "/dav/" "/dav/notes/a%20b.edn")
    ;; => ["notes" "a b.edn"]
sourceraw docstring

resolveclj/s

(resolve root base s)

The path of the URL or absolute path s below the root of a share, resolved against the absolute path base, e.g. the :uri of the request. Only the path of the URL counts. It's nil when s isn't a URL or isn't below the root, and :invalid as for parse.

The path of the URL or absolute path `s` below the `root` of a share,
resolved against the absolute path `base`, e.g. the :uri of the request.
Only the path of the URL counts. It's nil when `s` isn't a URL or isn't
below the root, and :invalid as for parse.
sourceraw docstring

rootclj/s

(root s)

The s as the root of a share: an absolute path with a slash at each end, e.g. /dav/ for dav. The other functions take a root in this form.

The `s` as the root of a share: an absolute path with a slash at each
end, e.g. /dav/ for dav. The other functions take a root in this form.
sourceraw docstring

segment?clj/s

(segment? s)

Whether the decoded segment s can name a resource: neither . nor .., and without a slash, a backslash, a control character or the U+FFFD that bytes that aren't UTF-8 decode to.

Whether the decoded segment `s` can name a resource: neither . nor ..,
and without a slash, a backslash, a control character or the U+FFFD
that bytes that aren't UTF-8 decode to.
sourceraw docstring

segmentsclj/s

(segments s)

The decoded segments of the percent-encoded path s, without the empty ones, or :invalid when a segment can't name a resource.

The decoded segments of the percent-encoded path `s`, without the empty
ones, or :invalid when a segment can't name a resource.
sourceraw docstring

within?clj/s

(within? ancestor path)

Whether the path is the path ancestor or below it.

Whether the `path` is the path `ancestor` or below it.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close