Local resources (material map, calibration files, field maps) have:
- fixed local file name (e.g. config/material-map.cbor),
- source location URL (e.g. https://eicweb.phy.anl.gov/EIC/detectors/athena/uploads/4a4e7c8eb6089b634d762d112c89bd5d/material-maps.cbor with hex hash 8b21c068916be3c4),
- optional cached local copy (e.g. /opt/detectors/resources/8b21c068916be3c4).
An updated source location URL should recreate local filename link (i.e. link should always be recreated if there is a chance it points to the wrong things).
A local configuration with custom files should no be modified (potentially limited by the fact that the local configuration should not use symlinks). No actual files should ever be deleted; at most links should be modified.
This will allow for clearer treatment of resources:
- create hash from URL,
- search for hash in cache,
- if found: link hash to cache,
- else: download from URL to hash,
- link local file to hash.