nc-photos/lib/use_case/ls_single_file.dart

16 lines
429 B
Dart
Raw Normal View History

2021-07-02 21:43:15 +02:00
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;
}