Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-01-14 10:58:13 +01:00 committed by Andy Scherzinger
parent 304d11e590
commit 9927a649dc
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 13 additions and 8 deletions

View file

@ -1,4 +1,4 @@
/*
/**
* Nextcloud Android client application
*
* @author Mario Danic

View file

@ -692,11 +692,15 @@ public class UploadFileOperation extends SyncOperation {
if (!unlockFolderResult.isSuccess()) {
return unlockFolderResult;
}
} else if (result.getCode() == ResultCode.SYNC_CONFLICT) {
getStorageManager().saveConflict(mFile, mFile.getEtagInConflict());
}
// delete temporal file
if (temporalFile != null && temporalFile.exists() && !temporalFile.delete()) {
Log_OC.e(TAG, "Could not delete temporal file " + temporalFile.getAbsolutePath());
}
return result;
}
@ -894,6 +898,11 @@ public class UploadFileOperation extends SyncOperation {
getStorageManager().saveConflict(mFile, mFile.getEtagInConflict());
}
// delete temporal file
if (temporalFile != null && temporalFile.exists() && !temporalFile.delete()) {
Log_OC.e(TAG, "Could not delete temporal file " + temporalFile.getAbsolutePath());
}
return result;
}
@ -902,7 +911,8 @@ public class UploadFileOperation extends SyncOperation {
RemoteOperationResult result = null;
if (mLocalBehaviour == FileUploader.LOCAL_BEHAVIOUR_COPY && !mOriginalStoragePath.equals(expectedPath)) {
String temporalPath = FileStorageUtils.getInternalTemporalPath(mAccount.name, mContext) + mFile.getRemotePath();
String temporalPath = FileStorageUtils.getInternalTemporalPath(mAccount.name, mContext) +
mFile.getRemotePath();
mFile.setStoragePath(temporalPath);
File temporalFile = new File(temporalPath);
@ -979,11 +989,6 @@ public class UploadFileOperation extends SyncOperation {
FileDataStorageManager.triggerMediaScan(newFile.getAbsolutePath());
break;
}
// delete temporal file
String temporalPath = FileStorageUtils.getInternalTemporalPath(mAccount.name, mContext) + mFile.getRemotePath();
temporalFile = new File(temporalPath);
temporalFile.delete();
}
/**