Skip to content

add new ParamFileSvc to access files currently in $PARAMFILESROOT

Gerhard Raven requested to merge paramfilesvc into master

Currently code directly opens files in ${PARAMSFILESROOT}, and manually (hopefully) manages eg. versioning of those files by adding versions to their names. In order to enable a migration to an intrinsically versions setup, a new instance of the IFileAccess service is added, the ParamFileSvc which support the file:// protocol which solely strips the protocol specification, and substitutes any environment variables in the filename, and it adds a new paramfile 'protocol', specified by a URL such as paramfile://data/somefile.ext.

The default configuration just replaces paramfile:/ with the contents a 'root' path specified by the Root property, which defaults to ${PARAMFILESROOT}

In addition, there is a Version property, which by default is empty, but if it is non-empty, the 'root' path (appended with .git) is assumed to host a (bare) git repo, and any access will now go through that repo, and the specified commit will be used to identify which version of the file to pick up. Note that value of the Version can be any revision understood by git_rev_parse, i.e. see here -- eg. a (partial-but-unique) commit id, a tag, a branch, ... "HEAD" are all valid options.

Both the Version and Root properties can be overruled on a case-by-case basis by specifying them as part of the query string of the URL, eg. by appending ?version=v03&root=/my/prefered/directory to the URL.

Edited by Gerhard Raven

Merge request reports