Added tests and functionality to ensure that caching and syncing works when the remote file is removed.

Added UI strings for sync and cache functionality
This commit is contained in:
Philipp Crocoll
2013-08-06 22:21:58 +02:00
parent 8693dfe9f4
commit 289e10e1c4
9 changed files with 328 additions and 40 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using Android.App;
@@ -57,7 +58,19 @@ namespace keepass2android.Io
public Stream OpenFileForRead(IOConnectionInfo ioc)
{
return IOConnection.OpenRead(ioc);
try
{
return IOConnection.OpenRead(ioc);
}
catch (WebException ex)
{
if ((ex.Response is HttpWebResponse) && (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound))
{
throw new FileNotFoundException("404!", ioc.Path, ex);
}
throw;
}
}
public IWriteTransaction OpenWriteTransaction(IOConnectionInfo ioc, bool useFileTransaction)