This may be worth a PR upstream, but jcrTools.uploadFile does not work with path segments with expanded namespaces e.g. "{http://jcr/nt/namespace}base". If it did, we could simplify some of this.