Implemented simple and basic file downloading

This commit is contained in:
2023-03-11 20:26:00 +01:00
parent d519bafe3b
commit 54153f1958
12 changed files with 505 additions and 312 deletions

View File

@ -14,10 +14,17 @@ abstract class WebdavApi<T> extends ApiRequest {
Future<ApiResponse> run();
static Future<WebDavClient> webdav = establishWebdavConnection();
static Future<String> webdavConnectString = buildWebdavConnectString();
static Future<WebDavClient> establishWebdavConnection() async {
SharedPreferences preferences = await SharedPreferences.getInstance();
return NextcloudClient("https://cloud.marianum-fulda.de/", username: preferences.getString("username"), password: preferences.getString("password"), loginName: preferences.getString("username")).webdav;
}
static Future<String> buildWebdavConnectString() async {
SharedPreferences preferences = await SharedPreferences.getInstance();
return "https://${preferences.getString("username")}:${preferences.getString("password")}@cloud.marianum-fulda.de/remote.php/dav/files/${preferences.getString("username")}/";
}
}