Skip to content

Improve file download#17099

Open
alperozturk96 wants to merge 5 commits into
masterfrom
improve-file-download
Open

Improve file download#17099
alperozturk96 wants to merge 5 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)

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
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@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)

@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3331
Correctness6767
Dodgy code215215
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3129
Performance4141
Security1616
Total413409

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!")
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.

2 participants