/// <summary> /// Downloads the binary file using the HTTP downloader /// </summary> /// <param name="url">The URL.</param> /// <param name="localFile">The local file to download to</param> public void DownloadBinaryFile(string url, string localFile) { EnsureDirectoryExist(localFile); _logger.Debug($"Download {url} to {localFile}"); var content = _webDownloader.DownloadBinary(url); if (content == null) { _logger.Warn($"No data received, can't save {localFile}"); return; } var file = File.OpenWrite(localFile); file.Write(content, 0, content.Length); file.Close(); }
public byte[] DownloadBinary(string url, bool noCache = false) { var data = GetFromCache(url); if (data != null && !noCache) { return(data.ByteData); } var webData = _webDownloader.DownloadBinary(url); if (webData != null) { _cache.Add(url, new CacheObject(url, webData)); } return(webData); }
public byte[] DownloadBinary(string url, bool noCache = false) { return(_webDownloader.DownloadBinary(url, noCache)); }