Fix spotbugs with Alper

Signed-off-by: Jonas Mayer <jonas.a.mayer@gmx.net>
This commit is contained in:
Jonas Mayer 2024-04-02 14:24:43 +02:00 committed by Alper Öztürk
parent e850b67139
commit 1794015c1d
2 changed files with 11 additions and 4 deletions

View File

@ -34,7 +34,6 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.operations.UploadFileOperation
import com.owncloud.android.operations.UploadFileOperation.uploadedSourcePath
import com.owncloud.android.utils.ErrorMessageAdapter
import com.owncloud.android.utils.theme.ViewThemeUtils
import java.io.File
@ -238,7 +237,7 @@ class FileUploadWorker(
}
private fun cleanupUploadProcess(result: RemoteOperationResult<Any?>, operation: UploadFileOperation) {
if (operation.originalStoragePath == uploadedSourcePath) {
if (operation.originalStoragePath == operation.uploadedSourcePath) {
// TODO
// This is not ideal fix. When uploading file to the encrypted folder server returns 404 FILE_NOT_FOUND
// However file upload successfully completed. This fix mimic success, if upload successfully completed with

View File

@ -998,11 +998,19 @@ public class UploadFileOperation extends SyncOperation {
}
}
public static String uploadedSourcePath;
private String uploadedSourcePath;
public String getUploadedSourcePath(){
return uploadedSourcePath;
}
public void setUploadedSourcePath(String uploadedSourcePath){
this.uploadedSourcePath = uploadedSourcePath;
}
private void logResult(RemoteOperationResult result, String sourcePath, String targetPath) {
if (result.isSuccess()) {
uploadedSourcePath = sourcePath;
setUploadedSourcePath(sourcePath);
Log_OC.i(TAG, "Upload of " + sourcePath + " to " + targetPath + ": " + result.getLogMessage());
} else {
if (result.getException() != null) {