mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: auto add date for manual webdav backup
This commit is contained in:
@@ -73,6 +73,21 @@ abstract final class Webdav {
|
||||
return null;
|
||||
}
|
||||
|
||||
static Future<List<String>> list() async {
|
||||
try {
|
||||
final list = await _client.readDir(_prefix);
|
||||
final names = <String>[];
|
||||
for (final item in list) {
|
||||
if ((item.isDir ?? true) || item.name == null) continue;
|
||||
names.add(item.name!);
|
||||
}
|
||||
return names;
|
||||
} catch (e, s) {
|
||||
_logger.warning('List failed', e, s);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
static void changeClient(String url, String user, String pwd) {
|
||||
_client = WebdavClient(url: url, user: user, pwd: pwd);
|
||||
Stores.setting.webdavUrl.put(url);
|
||||
|
||||
Reference in New Issue
Block a user