private async Task DownloadRulePackage(RulePackage rulePackage) { if (rulePackage == null) { return; } var downloadUrl = $"http://www.arcgis.com/sharing/rest/content/items/{rulePackage.ID}/data"; var fileName = Path.Combine(_rulePkgPath, $"{rulePackage.Name}"); EsriHttpClient esriHttpClient = new EsriHttpClient(); await esriHttpClient.GetAsFileAsync(downloadUrl, fileName); }
private async Task DownloadRulePackage(RulePackage rulePackage) { if (rulePackage == null) { return; } var path = System.IO.Path.Combine(_rulePkgPath, rulePackage.Portalitem.Name); if (System.IO.Path.GetExtension(path) == "") { path = System.IO.Path.ChangeExtension(path, "tmp"); } //Download await rulePackage.Portalitem.GetItemDataAsync(path); }