File tree 2 files changed +7
-2
lines changed
app/src/main/java/com/owncloud/android/operations
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -301,6 +301,8 @@ private void requestForUpload(OCFile file) {
301
301
}
302
302
303
303
private void requestForDownload (OCFile file ) {
304
+ final var fileDownloadHelper = FileDownloadHelper .Companion .instance ();
305
+
304
306
if (syncInBackgroundWorker ) {
305
307
Log_OC .d ("InternalTwoWaySyncWork" , "download file: " + file .getFileName ());
306
308
@@ -313,6 +315,7 @@ private void requestForDownload(OCFile file) {
313
315
String filename = file .getFileName ();
314
316
if (filename != null ) {
315
317
if (result .isSuccess ()) {
318
+ fileDownloadHelper .saveFile (file , operation , getStorageManager ());
316
319
Log_OC .d (TAG , "requestForDownload completed for: " + file .getFileName ());
317
320
} else {
318
321
Log_OC .d (TAG , "requestForDownload failed for: " + file .getFileName ());
@@ -322,7 +325,7 @@ private void requestForDownload(OCFile file) {
322
325
Log_OC .d (TAG , "Exception caught at requestForDownload" + e );
323
326
}
324
327
} else {
325
- FileDownloadHelper . Companion . instance () .downloadFile (mUser , file );
328
+ fileDownloadHelper .downloadFile (mUser , file );
326
329
}
327
330
}
328
331
Original file line number Diff line number Diff line change @@ -446,6 +446,8 @@ private void syncContents() throws OperationCancelledException {
446
446
}
447
447
448
448
private void startDirectDownloads () {
449
+ final var fileDownloadHelper = FileDownloadHelper .Companion .instance ();
450
+
449
451
if (syncInBackgroundWorker ) {
450
452
try {
451
453
for (OCFile file : mFilesForDirectDownload ) {
@@ -468,6 +470,7 @@ private void startDirectDownloads() {
468
470
}
469
471
470
472
if (result .isSuccess ()) {
473
+ fileDownloadHelper .saveFile (file , operation , getStorageManager ());
471
474
Log_OC .d (TAG , "startDirectDownloads completed for: " + file .getFileName ());
472
475
} else {
473
476
Log_OC .d (TAG , "startDirectDownloads failed for: " + file .getFileName ());
@@ -477,7 +480,6 @@ private void startDirectDownloads() {
477
480
Log_OC .d (TAG , "Exception caught at startDirectDownloads" + e );
478
481
}
479
482
} else {
480
- final var fileDownloadHelper = FileDownloadHelper .Companion .instance ();
481
483
mFilesForDirectDownload .forEach (file -> fileDownloadHelper .downloadFile (user , file ));
482
484
}
483
485
}
You can’t perform that action at this time.
0 commit comments