started working on FTP(S) implementation using netftp and introduction of "server accounts"

This commit is contained in:
Philipp Crocoll
2016-02-03 12:43:37 +01:00
parent 91059a8349
commit c694ed0f96
14 changed files with 120 additions and 141 deletions

View File

@@ -255,6 +255,11 @@ namespace keepass2android.Io
}
}
public void ResolveAccount(IOConnectionInfo ioc)
{
}
}
class AndroidContentWriteTransaction : IWriteTransaction

View File

@@ -395,6 +395,11 @@ namespace keepass2android.Io
return false;
}
public void ResolveAccount(IOConnectionInfo ioc)
{
}
private bool IsLocalFileFlaggedReadOnly(IOConnectionInfo ioc)
{
try

View File

@@ -563,6 +563,11 @@ namespace keepass2android.Io
return _cachedStorage.IsReadOnly(ioc, reason);
}
public void ResolveAccount(IOConnectionInfo ioc)
{
_cachedStorage.ResolveAccount(ioc);
}
private void StoreFilePath(IOConnectionInfo folderPath, string filename, IOConnectionInfo res)
{
File.WriteAllText(CachedFilePath(GetPseudoIoc(folderPath, filename)) + ".filepath", res.Path);

View File

@@ -177,7 +177,12 @@ namespace keepass2android.Io
/// </summary>
bool IsReadOnly(IOConnectionInfo ioc, OptionalOut<UiStringKey> reason = null );
/// <summary>
/// if the ioc.Path contains a string which refers to a stored account (like FTP account with specific settings),
/// this method resolves the path so that it is a path which can be consumed by the file storage "operational" methods (=all other methods)
/// </summary>
/// <param name="ioc"></param>
void ResolveAccount(IOConnectionInfo ioc);
}
public interface IPermissionRequestingFileStorage

View File

@@ -294,6 +294,11 @@ namespace keepass2android.Io
return false; //TODO implement. note, however, that we MAY return false even if it's read-only
}
public void ResolveAccount(IOConnectionInfo ioc)
{
}
public void OnCreate(IFileStorageSetupActivity activity, Bundle savedInstanceState)
{
_jfs.OnCreate(((IJavaFileStorageFileStorageSetupActivity)activity), savedInstanceState);

View File

@@ -181,6 +181,11 @@ namespace keepass2android.Io
return _baseStorage.IsReadOnly(ioc, reason);
}
public void ResolveAccount(IOConnectionInfo ioc)
{
_baseStorage.ResolveAccount(ioc);
}
public void OnRequestPermissionsResult(IFileStorageSetupActivity fileStorageSetupActivity, int requestCode,
string[] permissions, Permission[] grantResults)
{