Skip to content

Commit 994cccc

Browse files
committed
v3.1.11109
1 parent fc17622 commit 994cccc

6 files changed

Lines changed: 34 additions & 11 deletions

File tree

iOS/WebDavCommon/LocationMapper.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ public class LocationMapper
1919
/// <param name="localStorageRoot">The local storage root.</param>
2020
public LocationMapper(Uri serverRootUri, string localStorageRoot)
2121
{
22-
this.ServerRoot = serverRootUri ?? throw new ArgumentNullException(nameof(serverRootUri));
22+
if(serverRootUri == null) throw new ArgumentNullException(nameof(serverRootUri));
23+
string serverRootUriAsString = serverRootUri.ToString();
24+
if(serverRootUriAsString.EndsWith("/")) {
25+
this.ServerRoot = serverRootUri;
26+
}
27+
else
28+
{
29+
this.ServerRoot = new Uri(serverRootUriAsString + "/");
30+
}
31+
2332
this.LocalStorageRoot = localStorageRoot ?? throw new ArgumentNullException(nameof(localStorageRoot));
2433
}
2534

iOS/WebDavCommon/WebDavCommon.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
</MtouchVerbosity>
4747
</PropertyGroup>
4848
<ItemGroup>
49-
<Reference Include="ITHit.WebDAV.Client, Version=3.1.1072.0, Culture=neutral, PublicKeyToken=2ed2d3f88a9114ce, processorArchitecture=MSIL">
50-
<HintPath>..\packages\ITHitWebDAVClient.3.1.1072\lib\Xamarin.iOS10\ITHit.WebDAV.Client.dll</HintPath>
49+
<Reference Include="ITHit.WebDAV.Client, Version=3.1.1109.0, Culture=neutral, PublicKeyToken=2ed2d3f88a9114ce, processorArchitecture=MSIL">
50+
<HintPath>..\packages\ITHitWebDAVClient.3.1.1109\lib\Xamarin.iOS10\ITHit.WebDAV.Client.dll</HintPath>
5151
</Reference>
5252
<Reference Include="System" />
5353
<Reference Include="System.Xml" />

iOS/WebDavCommon/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ITHitWebDAVClient" version="3.1.1072" targetFramework="xamarinios10" />
3+
<package id="ITHitWebDAVClient" version="3.1.1109" targetFramework="xamarinios10" />
44
</packages>

iOS/WebDavContainer/ViewController.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ public partial class ViewController : UIViewController
1515

1616
private const string ErrorTitle = "Error";
1717

18-
private const string InvalidUriTitle = "Server URL is invalid";
18+
private const string InvalidUriTitle = "Server URL is invalid.";
1919

20-
private const string InvalidUriMessage = "Input valid server URL";
20+
private const string EmptyUriMessage = "Provide WebDAV server URL.";
21+
22+
private const string IncorrectServerNameMessage = "Incorrect server name.";
2123

2224
/// <inheritdoc />
2325
protected ViewController(IntPtr handle) : base(handle)
@@ -50,7 +52,8 @@ async partial void Login_Clicked(UIButton sender)
5052

5153
if (string.IsNullOrEmpty(serverUri) || string.IsNullOrWhiteSpace(serverUri))
5254
{
53-
this.ShowAlert(InvalidUriTitle, InvalidUriMessage);
55+
this.ShowAlert(InvalidUriTitle, EmptyUriMessage);
56+
return;
5457
}
5558

5659

@@ -66,14 +69,25 @@ async partial void Login_Clicked(UIButton sender)
6669
AppGroupSettings.SaveServerSettings(serverSettings);
6770
this.ShowAlert(LoginSuccessfulTitle, LoginSuccessfulMessage);
6871
}
72+
catch (System.Net.WebException ex)
73+
{
74+
if(ex.Status == System.Net.WebExceptionStatus.NameResolutionFailure)
75+
{
76+
this.ShowAlert(InvalidUriTitle, IncorrectServerNameMessage);
77+
}
78+
else
79+
{
80+
this.ShowAlert(ErrorTitle, ex.Message);
81+
}
82+
}
6983
catch (Exception ex)
7084
{
7185
this.ShowAlert(ErrorTitle, ex.Message);
7286
}
7387
finally
7488
{
7589
sender.Enabled = true;
76-
}
90+
}
7791

7892
this.Editing = false;
7993
this.Server.ResignFirstResponder();

iOS/WebDavContainerExtension/WebDavContainerExtension.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@
139139
<AppExtensionDebugBundleId />
140140
</PropertyGroup>
141141
<ItemGroup>
142-
<Reference Include="ITHit.WebDAV.Client, Version=3.1.1072.0, Culture=neutral, PublicKeyToken=2ed2d3f88a9114ce, processorArchitecture=MSIL">
143-
<HintPath>..\packages\ITHitWebDAVClient.3.1.1072\lib\Xamarin.iOS10\ITHit.WebDAV.Client.dll</HintPath>
142+
<Reference Include="ITHit.WebDAV.Client, Version=3.1.1109.0, Culture=neutral, PublicKeyToken=2ed2d3f88a9114ce, processorArchitecture=MSIL">
143+
<HintPath>..\packages\ITHitWebDAVClient.3.1.1109\lib\Xamarin.iOS10\ITHit.WebDAV.Client.dll</HintPath>
144144
</Reference>
145145
<Reference Include="System" />
146146
<Reference Include="System.Core" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="ITHitWebDAVClient" version="3.1.1072" targetFramework="xamarinios10" />
3+
<package id="ITHitWebDAVClient" version="3.1.1109" targetFramework="xamarinios10" />
44
</packages>

0 commit comments

Comments
 (0)