Use filename instead path
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
b523c34d29
commit
5b51aed284
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue