mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
new: webdav sync test
This commit is contained in:
@@ -16,6 +16,17 @@ abstract final class Webdav {
|
||||
pwd: Stores.setting.webdavPwd.fetch(),
|
||||
);
|
||||
|
||||
static Future<String?> test(String url, String user, String pwd) async {
|
||||
final client = WebdavClient(url: url, user: user, pwd: pwd);
|
||||
try {
|
||||
await client.ping();
|
||||
return null;
|
||||
} catch (e, s) {
|
||||
Loggers.app.warning('Webdav test failed', e, s);
|
||||
return e.toString();
|
||||
}
|
||||
}
|
||||
|
||||
static Future<WebdavErr?> upload({
|
||||
required String relativePath,
|
||||
String? localPath,
|
||||
|
||||
Reference in New Issue
Block a user