MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / DownloadFile

Method DownloadFile

loader/Main/Updater.cs:177–189  ·  view source on GitHub ↗
(string url, string path, Action<long, long, int> onProgress)

Source from the content-addressed store, hash-verified

175 }
176
177 static async Task DownloadFile(string url, string path, Action<long, long, int> onProgress)
178 {
179 using (WebClient client = new WebClient())
180 {
181 client.Headers.Add("User-Agent", USER_AGENT);
182 client.DownloadProgressChanged += (s, e) =>
183 {
184 onProgress.Invoke(e.BytesReceived, e.TotalBytesToReceive, e.ProgressPercentage);
185 };
186
187 await client.DownloadFileTaskAsync(new Uri(url), path);
188 }
189 }
190
191 static void ApplyUpdate(string updateDir)
192 {

Callers

nothing calls this directly

Calls 1

InvokeMethod · 0.80

Tested by

no test coverage detected