Skip to content

Commit

Permalink
Allow instantiation of WebDavClient with HttpClient instance (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
skazantsev committed Jun 8, 2018
1 parent f391670 commit 751f038
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/WebDav.Client/WebDavClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,21 @@ public WebDavClient()
/// <param name="params">The parameters of the WebDAV client.</param>
public WebDavClient(WebDavClientParams @params)
{
SetWebDavDispatcher(new WebDavDispatcher(ConfigureHttpClient(@params)));
Initialize(ConfigureHttpClient(@params));
}

/// <summary>
/// Initializes a new instance of the <see cref="WebDavClient"/> class.
/// </summary>
/// <param name="httpClient">The pre-configured instance of <see cref="HttpClient"/>.</param>
public WebDavClient(HttpClient httpClient)
{
Initialize(httpClient);
}

private void Initialize(HttpClient httpClient)
{
SetWebDavDispatcher(new WebDavDispatcher(httpClient));

var lockResponseParser = new LockResponseParser();
SetPropfindResponseParser(new PropfindResponseParser(lockResponseParser));
Expand Down

0 comments on commit 751f038

Please sign in to comment.