nc-photos/lib/use_case/ls_single_file.dart
2021-07-03 17:11:30 +08:00

15 lines
429 B
Dart

import 'package:nc_photos/account.dart';
import 'package:nc_photos/entity/file.dart';
import 'package:nc_photos/entity/file/data_source.dart';
class LsSingleFile {
LsSingleFile(this.dataSrc);
Future<File> call(Account account, String path) async {
final files = await dataSrc.list(account, File(path: path), depth: 0);
assert(files.length == 1);
return files.first;
}
final FileWebdavDataSource dataSrc;
}