debug
This commit is contained in:
@@ -137,6 +137,7 @@ Future<void> upload(SyncItemConfig item, bool needCreateDir) async {
|
||||
}
|
||||
|
||||
Future<void> download(SyncItemConfig item, dav.File cloudArchive) async {
|
||||
print('Start download: ${cloudArchive.path}');
|
||||
var cacheDir = await getApplicationCacheDirectory();
|
||||
var zipPath = join(cacheDir.path, '${item.name}_${cloudArchive.name}');
|
||||
await _client.read2File(cloudArchive.path!, zipPath);
|
||||
@@ -144,8 +145,10 @@ Future<void> download(SyncItemConfig item, dav.File cloudArchive) async {
|
||||
File(zipPath).delete();
|
||||
|
||||
var temp = File(join(cacheDir.path, basename(item.path)));
|
||||
print('Temp path: ${temp.path}');
|
||||
var fileSystemEntityType = temp.statSync().type;
|
||||
|
||||
switch (temp.statSync().type) {
|
||||
switch (fileSystemEntityType) {
|
||||
case FileSystemEntityType.directory:
|
||||
var directory = Directory(item.path);
|
||||
if (directory.existsSync()) {
|
||||
@@ -160,6 +163,7 @@ Future<void> download(SyncItemConfig item, dav.File cloudArchive) async {
|
||||
}
|
||||
temp.renameSync(item.path);
|
||||
default:
|
||||
print('Failed: $fileSystemEntityType');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user