Repository navigation
Fixes
- A variant named
"0"is now built fromvariantPathTemplate. 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()), whichFileimplements.PathBuilderstores such a file under the newhashPathTemplate, defaultblobs{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 pathstore()would write to, without writing (#5).PathBuilderoptionlowercaseExtension(defaultfalse) lowercases{extension}inpathTemplateandvariantPathTemplate. The hash template always uses the lower case extension (#5).File::toArray()and the JSON output gain ahashkey (#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 likec++, a regenerated variant for example, now usesc(#5, #6).
FileInterface is unchanged, so existing implementations of it keep working.
Full Changelog: 1.0.1...1.1.0