retrieve(url, type) {
    var deferred = new core["defer"]();
    var response;
    var path = new utils_path["a" /* default */](url); // If type isn't set, determine it from the file extension

    if (!type) {
      type = path.extension;
    }

    if (type == "blob") {
      response = this.getBlob(url);
    } else {
      response = this.getText(url);
    }

    return response.then(r => {
      var deferred = new core["defer"]();
      var result;

      if (r) {
        result = this.handleResponse(r, type);
        deferred.resolve(result);
      } else {
        deferred.reject({
          message: "File not found in storage: " + url,
          stack: new Error().stack
        });
      }

      return deferred.promise;
    });
  }
Request a url from storage
@param  {string} url  a url to request from storage
@param  {string} [type] specify the type of the returned result
@return {Promise<Blob | string | JSON | Document | XMLDocument>}