@@ -1300,15 +1300,21 @@ private void handleLocalBehaviour(File temporalFile,
13001300 File expectedFile ,
13011301 File originalFile ,
13021302 OwnCloudClient client ) {
1303+
1304+ // only LOCAL_BEHAVIOUR_COPY not using original file
1305+ if (mLocalBehaviour != FileUploadWorker .LOCAL_BEHAVIOUR_COPY ) {
1306+ // if file is not exists we should only delete from our app
1307+ deleteNonExistingFile (originalFile );
1308+ }
1309+
1310+ Log_OC .d (TAG , "handling local behaviour for: " + originalFile .getName () + " behaviour: " + mLocalBehaviour );
1311+
13031312 switch (mLocalBehaviour ) {
13041313 case FileUploadWorker .LOCAL_BEHAVIOUR_DELETE :
13051314 try {
13061315 Files .delete (originalFile .toPath ());
13071316 } catch (IOException e ) {
13081317 Log_OC .e (TAG , "Could not delete original file: " + originalFile .getAbsolutePath (), e );
1309-
1310- // if file is not exists we should only delete from our app
1311- deleteNonExistingFile (originalFile );
13121318 }
13131319 mFile .setStoragePath ("" );
13141320 getStorageManager ().deleteFileInMediaScan (originalFile .getAbsolutePath ());
@@ -1321,6 +1327,9 @@ private void handleLocalBehaviour(File temporalFile,
13211327 move (temporalFile , expectedFile );
13221328 } catch (IOException e ) {
13231329 Log_OC .e (TAG , e .getMessage ());
1330+
1331+ // handling non-existing file for local copy as well
1332+ deleteNonExistingFile (temporalFile );
13241333 }
13251334 } else if (originalFile != null ) {
13261335 try {
0 commit comments