Skip to content

1.1.0

Latest

Choose a tag to compare

@dereuromark dereuromark released this 07 Oct 16:31
0ee5140

Fixes

  • A variant named "0" is now built from variantPathTemplate. It was treated as "no variant" and got the path of the original (#5).

Improvements

  • Content addressed paths: a file can carry a hash of its content through the new ContentHashInterface (hash(), withHash()), which File implements. PathBuilder stores such a file under the new hashPathTemplate, default blobs{ds}{hashPath}{ds}{hash}.{extension}, so files with the same hash and extension resolve to one path. New placeholders {hash} and {hashPath} are available in every template (#5).
  • withHash() accepts hexadecimal digests only and stores them in lower case (#5).
  • FileStorage::buildPath() returns the path store() would write to, without writing (#5).
  • PathBuilder option lowercaseExtension (default false) lowercases {extension} in pathTemplate and variantPathTemplate. The hash template always uses the lower case extension (#5).
  • File::toArray() and the JSON output gain a hash key (#5).

Behavior change

  • Characters other than letters, digits, hyphens and underscores are removed from {extension} when a path is built. The extension comes from the uploaded filename and reached the path unchecked. Paths you have stored are not affected. A path that is built again for a file stored earlier under an extension like c++, a regenerated variant for example, now uses c (#5, #6).

FileInterface is unchanged, so existing implementations of it keep working.

Full Changelog: 1.0.1...1.1.0