Skip to content

Commit bd74a87

Browse files
committed
add Http.DownloadAsync
1 parent a3975a3 commit bd74a87

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Flow.Launcher.Plugin/IPublicAPI.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Flow.Launcher.Plugin.SharedModel;
2+
using JetBrains.Annotations;
23
using System;
34
using System.Collections.Generic;
45
using System.IO;
@@ -92,5 +93,7 @@ public interface IPublicAPI
9293
Task<string> HttpGetStringAsync(string url, CancellationToken token = default);
9394

9495
Task<Stream> HttpGetStreamAsync(string url, CancellationToken token = default);
96+
97+
Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath);
9598
}
9699
}

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using System.Threading;
1919
using System.IO;
2020
using Flow.Launcher.Infrastructure.Http;
21+
using JetBrains.Annotations;
2122

2223
namespace Flow.Launcher
2324
{
@@ -96,7 +97,7 @@ public void ShowMsg(string title, string subTitle, string iconPath, bool useMain
9697
{
9798
Application.Current.Dispatcher.Invoke(() =>
9899
{
99-
var msg = useMainWindowAsOwner ? new Msg {Owner = Application.Current.MainWindow} : new Msg();
100+
var msg = useMainWindowAsOwner ? new Msg { Owner = Application.Current.MainWindow } : new Msg();
100101
msg.Show(title, subTitle, iconPath);
101102
});
102103
}
@@ -143,6 +144,11 @@ public Task<Stream> HttpGetStreamAsync(string url, CancellationToken token = def
143144
return Http.GetStreamAsync(url);
144145
}
145146

147+
public Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath)
148+
{
149+
return Http.DownloadAsync(url, filePath);
150+
}
151+
146152
#endregion
147153

148154
#region Private Methods

0 commit comments

Comments
 (0)