Liking cljdoc? Tell your friends :D

co.deps.ring-etag-middleware


add-file-etagclj

(add-file-etag response extended-attributes?)
source

checksum-attribute-nameclj

source

checksum-fileclj

(checksum-file file)

Calculate a CRC32 checksum for a File.

Calculate a CRC32 checksum for a File.
sourceraw docstring

get-attributeclj

(get-attribute path attribute)
source

get-user-defined-attribute-viewclj

(get-user-defined-attribute-view path)
source

set-attributeclj

(set-attribute path attribute value)
source

supports-extended-attributes?clj

(supports-extended-attributes? path)

Java's UserDefinedFileAttributes (a.k.a. extended attributes) do not support extended attributes on all platforms, notably HFS+ and APFS on macOS.

Waiting for https://bugs.openjdk.java.net/browse/JDK-8030048 to add macOS support.

Java's UserDefinedFileAttributes (a.k.a. extended attributes) do not support
extended attributes on all platforms, notably HFS+ and APFS on macOS.

Waiting for https://bugs.openjdk.java.net/browse/JDK-8030048 to add macOS support.
sourceraw docstring

wrap-file-etagclj

(wrap-file-etag handler)
(wrap-file-etag handler {:keys [extended-attributes?] :as options})

Calculates an ETag for a Ring response which contains a File as the body.

If extended-attributes? is true, then the File is first checked for a checksum in it's extended attributes, if it doesn't exist then it is calculated and added to the file, and returned in the ETag. This is much faster than calculating the checksum each time (which is already fast), but isn't supported on all platforms, notably macOS.

If you wish to store the checksum in extended attributes, it is recommended that you first check if the Path that you are wanting to serve files from supports it. You can use the provided supports-extended-attributes? function for this.

Calculates an ETag for a Ring response which contains a File as the body.

If extended-attributes? is true, then the File is first checked for a
checksum in it's extended attributes, if it doesn't exist then it is
calculated and added to the file, and returned in the ETag. This is
much faster than calculating the checksum each time (which is already
fast), but isn't supported on all platforms, notably macOS.

If you wish to store the checksum in extended attributes, it is
recommended that you first check if the Path that you are wanting
to serve files from supports it. You can use the provided
supports-extended-attributes? function for this.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close