mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
new: webdav sync
This commit is contained in:
@@ -4,7 +4,9 @@ enum ErrFrom {
|
||||
docker,
|
||||
sftp,
|
||||
ssh,
|
||||
status;
|
||||
status,
|
||||
icloud,
|
||||
webdav,;
|
||||
}
|
||||
|
||||
abstract class Err<T> {
|
||||
@@ -61,10 +63,25 @@ enum ICloudErrType {
|
||||
|
||||
class ICloudErr extends Err<ICloudErrType> {
|
||||
ICloudErr({required ICloudErrType type, String? message})
|
||||
: super(from: ErrFrom.docker, type: type, message: message);
|
||||
: super(from: ErrFrom.icloud, type: type, message: message);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ICloudErr<$type>: $message';
|
||||
}
|
||||
}
|
||||
|
||||
enum WebdavErrType {
|
||||
generic,
|
||||
notFound,;
|
||||
}
|
||||
|
||||
class WebdavErr extends Err<WebdavErrType> {
|
||||
WebdavErr({required WebdavErrType type, String? message})
|
||||
: super(from: ErrFrom.webdav, type: type, message: message);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'WebdavErr<$type>: $message';
|
||||
}
|
||||
}
|
||||
|
||||
13
lib/data/model/app/remote_storage.dart
Normal file
13
lib/data/model/app/remote_storage.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
abstract class RemoteStorage {
|
||||
Future<Error> upload({
|
||||
required String relativePath,
|
||||
String? localPath
|
||||
});
|
||||
|
||||
Future<Error> download({
|
||||
required String relativePath,
|
||||
String? localPath
|
||||
});
|
||||
|
||||
Future<Error> delete(String relativePath);
|
||||
}
|
||||
Reference in New Issue
Block a user