using concurrentusing afIocusing afIocConfig::Configusing afIocEnvusing afBedSheet** (Service) - Creates client-side asset URIs. constmixin ColdFeet {** Converts the given client URI into a cachable 'Cold Feet' URI that can be used by clients / browsers. ** Essentially this adds the prefix and checksum to the given URI, as well as checking for URI validity and that ** the corresponding file exists. ** ** The URI **must** ** be mapped by [BedSheet's]`http://www.fantomfactory.org/pods/afBedSheet` 'FileHandler' service.abstract Uri assetUri(Uri uri)** Converts the given asset File into a cachable 'Cold Feet' URI that can be used by clients / browsers. ** ** The asset **must** exist on the file system and ** be mapped by [BedSheet's]`http://www.fantomfactory.org/pods/afBedSheet` 'FileHandler' service.abstract Uri assetFile(File asset) @NoDocabstract Uri clientUri(Str checksum, Uri absUri)}internalconstclass ColdFeetImpl : ColdFeet { @Inject privateconst FileHandler fileHandler @Inject privateconst HttpRequest httpRequest @Inject privateconst ChecksumStrategy checksumStrategy @Config { id="afColdFeet.assetPrefix"} @Inject privateconst Uri assetPrefix new make(|This|in){ in(this)}override Uri assetUri(Uri uri){ file := fileHandler.fromClientUri(uri, true) checksum := checksumStrategy.checksum(file)return clientUri(checksum, uri)}override Uri assetFile(File asset){ assetUri := fileHandler.fromServerFile(asset) checksum := checksumStrategy.checksum(asset)return clientUri(checksum, assetUri)}override Uri clientUri(Str checksum, Uri absUri){// add extra WebMod paths - but only if we're part of a web request! clientUri := (Actor.locals["web.req"] != null && httpRequest.modBase != `/`) ? httpRequest.modBase : ``return clientUri.plusSlash + assetPrefix.relTo(`/`).plusSlash + checksum.toUri.plusSlash + absUri.relTo(`/`)}}