Use filename instead path

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-04-03 14:04:36 +02:00 committed by Alper Öztürk
parent b523c34d29
commit 5b51aed284
2 changed files with 10 additions and 7 deletions

View File

@ -237,7 +237,7 @@ class FileUploadWorker(
}
private fun cleanupUploadProcess(result: RemoteOperationResult<Any?>, operation: UploadFileOperation) {
if (operation.originalStoragePath == operation.uploadedSourcePath) {
if (operation.originalStoragePath.contains(operation.uploadedFilename)) {
// 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,19 +998,22 @@ public class UploadFileOperation extends SyncOperation {
}
}
private String uploadedSourcePath;
private String uploadedFilename;
public String getUploadedSourcePath(){
return uploadedSourcePath;
public String getUploadedFilename(){
return uploadedFilename;
}
public void setUploadedSourcePath(String uploadedSourcePath){
this.uploadedSourcePath = uploadedSourcePath;
public void setUploadedFilename(String uploadedFilename){
this.uploadedFilename = uploadedFilename;
}
private void logResult(RemoteOperationResult result, String sourcePath, String targetPath) {
if (result.isSuccess()) {
setUploadedSourcePath(sourcePath);
int lastIndex = sourcePath.lastIndexOf("/");
String filename = sourcePath.substring(lastIndex + 1);
setUploadedFilename(filename);
Log_OC.i(TAG, "Upload of " + sourcePath + " to " + targetPath + ": " + result.getLogMessage());
} else {
if (result.getException() != null) {