Skip to content

Improve DownloadFileOperation#17099

Merged
alperozturk96 merged 4 commits into
masterfrom
improve-file-download
Jun 24, 2026
Merged

Improve DownloadFileOperation#17099
alperozturk96 merged 4 commits into
masterfrom
improve-file-download

Conversation

@alperozturk96

Copy link
Copy Markdown
Collaborator

Changes

  • Converts Java to Kotlin
  • Simplifies logic
  • Fixes move logic

@github-actions

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/26567296559/artifacts/7263265310
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@github-actions

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/27261334268/artifacts/7529683041
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Log_OC.d(TAG, "trying to move: $tempFilePath to $newFilePath")

return try {
Files.move(tempFilePath, newFilePath, StandardCopyOption.REPLACE_EXISTING)
Log_OC.d(TAG, "trying to move: $tempFilePath to $newFilePath")

return try {
Files.move(tempFilePath, newFilePath, StandardCopyOption.REPLACE_EXISTING)

return try {
Files.move(tempFilePath, newFilePath, StandardCopyOption.REPLACE_EXISTING)
newFile.setLastModified(file.modificationTimestamp)
currentResult: RemoteOperationResult<Unit>
): RemoteOperationResult<Unit> {
FileExportUtils().exportFile(file.fileName, file.mimeType, operationContext.contentResolver, null, tmpFile)
if (!tmpFile.delete()) Log_OC.e(TAG, "Deletion of ${tmpFile.absolutePath} failed!")
@alperozturk96 alperozturk96 force-pushed the improve-file-download branch from b468b11 to 2afd038 Compare June 24, 2026 05:18
@alperozturk96 alperozturk96 changed the title Improve file download Improve DownloadFileOperation Jun 24, 2026
@github-actions

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/28077314929/artifacts/7840968657
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>

# Conflicts:
#	app/src/main/java/com/owncloud/android/operations/DownloadFileOperation.kt

# Conflicts:
#	app/src/main/java/com/owncloud/android/operations/DownloadFileOperation.kt
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96 alperozturk96 force-pushed the improve-file-download branch from 85e25ee to 955310b Compare June 24, 2026 09:02
@alperozturk96 alperozturk96 merged commit cf1f780 into master Jun 24, 2026
17 of 21 checks passed
@alperozturk96 alperozturk96 deleted the improve-file-download branch June 24, 2026 09:03
@github-actions

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/28087439054/artifacts/7845020086
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@github-actions

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3331
Correctness6767
Dodgy code211211
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3129
Performance4141
Security1616
Total409405

@github-actions

Copy link
Copy Markdown

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants