/// <summary> /// Tries to download and write a specific file (resource) to the disk in a defined path. /// This method creates the respective parent directory, if needed. /// </summary> public static void FetchFile(BackgroundWorker bw, string path, string resource, string expectedHash) { new FileInfo(path).Directory.Create(); HttpClientDownloader.DownloadData(bw, resource, expectedHash, path); }
/// <summary> /// Downloads and validates the server metadata file. /// Returns it as a string. /// </summary> private static string DownloadServerMetadataFile() { // There is no expected hash for the server metadata file, and it should be downloaded directly into memory. return(Utils.PerformPatchDirectorySanityCheck(HttpClientDownloader.DownloadData(BW, EngineConfigs.PATCH_METADATA, null, string.Empty))); }
/// <summary> /// Downloads and validates the server metadata file. /// Returns it as a string. /// </summary> private static string DownloadServerMetadataFile() { // There is no expected hash for the server metadata file. return(Utils.PerformPatchDirectorySanityCheck(HttpClientDownloader.DownloadData(BW, EngineConfigs.PATCH_METADATA, null))); }