@@ -85,8 +85,9 @@ public enum Action {
8585 private static ArbitraryDataProvider arbitraryDataProvider ;
8686
8787 private OCFile currentFolder ;
88- private int actionCount = 20 ;
88+ private final int actionCount = 20 ;
8989 private String rootEncFolder = "/e/" ;
90+ private final String nonEmptyFileName = "nonEmpty.txt" ;
9091
9192 @ Rule
9293 public RetryTestRule retryTestRule = new RetryTestRule ();
@@ -405,15 +406,17 @@ private void downloadFile(int i) {
405406 public void testUploadWithCopy () throws Exception {
406407 init ();
407408
408- OCUpload ocUpload = new OCUpload (FileStorageUtils .getTemporalPath (account .name ) + "/nonEmpty.txt" ,
409- currentFolder .getRemotePath () + "nonEmpty.txt" ,
409+ OCUpload ocUpload = new OCUpload (FileStorageUtils .getInternalTemporalPath (account .name , targetContext )
410+ + nonEmptyFileName ,
411+ currentFolder .getRemotePath () + nonEmptyFileName ,
410412 account .name );
411413
412414 uploadOCUpload (ocUpload , FileUploader .LOCAL_BEHAVIOUR_COPY );
413415
414- File originalFile = new File (FileStorageUtils .getTemporalPath (account .name ) + "/nonEmpty.txt" );
416+ File originalFile = new File (FileStorageUtils .getInternalTemporalPath (account .name , targetContext )
417+ + nonEmptyFileName );
415418 OCFile uploadedFile = fileDataStorageManager .getFileByDecryptedRemotePath (currentFolder .getRemotePath () +
416- "nonEmpty.txt" );
419+ nonEmptyFileName );
417420
418421 assertTrue (originalFile .exists ());
419422 assertTrue (new File (uploadedFile .getStoragePath ()).exists ());
@@ -423,15 +426,17 @@ public void testUploadWithCopy() throws Exception {
423426 public void testUploadWithMove () throws Exception {
424427 init ();
425428
426- OCUpload ocUpload = new OCUpload (FileStorageUtils .getTemporalPath (account .name ) + "/nonEmpty.txt" ,
427- currentFolder .getRemotePath () + "nonEmpty.txt" ,
429+ OCUpload ocUpload = new OCUpload (FileStorageUtils .getInternalTemporalPath (account .name , targetContext )
430+ + nonEmptyFileName ,
431+ currentFolder .getRemotePath () + nonEmptyFileName ,
428432 account .name );
429433
430434 uploadOCUpload (ocUpload , FileUploader .LOCAL_BEHAVIOUR_MOVE );
431435
432- File originalFile = new File (FileStorageUtils .getTemporalPath (account .name ) + "/nonEmpty.txt" );
436+ File originalFile = new File (FileStorageUtils .getInternalTemporalPath (account .name , targetContext )
437+ + nonEmptyFileName );
433438 OCFile uploadedFile = fileDataStorageManager .getFileByDecryptedRemotePath (currentFolder .getRemotePath () +
434- "nonEmpty.txt" );
439+ nonEmptyFileName );
435440
436441 assertFalse (originalFile .exists ());
437442 assertTrue (new File (uploadedFile .getStoragePath ()).exists ());
@@ -441,15 +446,17 @@ public void testUploadWithMove() throws Exception {
441446 public void testUploadWithForget () throws Exception {
442447 init ();
443448
444- OCUpload ocUpload = new OCUpload (FileStorageUtils .getTemporalPath (account .name ) + "/nonEmpty.txt" ,
445- currentFolder .getRemotePath () + "nonEmpty.txt" ,
449+ OCUpload ocUpload = new OCUpload (FileStorageUtils .getInternalTemporalPath (account .name , targetContext )
450+ + nonEmptyFileName ,
451+ currentFolder .getRemotePath () + nonEmptyFileName ,
446452 account .name );
447453
448454 uploadOCUpload (ocUpload , FileUploader .LOCAL_BEHAVIOUR_FORGET );
449455
450- File originalFile = new File (FileStorageUtils .getTemporalPath (account .name ) + "/nonEmpty.txt" );
456+ File originalFile = new File (FileStorageUtils .getInternalTemporalPath (account .name , targetContext )
457+ + nonEmptyFileName );
451458 OCFile uploadedFile = fileDataStorageManager .getFileByDecryptedRemotePath (currentFolder .getRemotePath () +
452- "nonEmpty.txt" );
459+ nonEmptyFileName );
453460
454461 assertTrue (originalFile .exists ());
455462 assertFalse (new File (uploadedFile .getStoragePath ()).exists ());
@@ -459,15 +466,17 @@ public void testUploadWithForget() throws Exception {
459466 public void testUploadWithDelete () throws Exception {
460467 init ();
461468
462- OCUpload ocUpload = new OCUpload (FileStorageUtils .getTemporalPath (account .name ) + "/nonEmpty.txt" ,
463- currentFolder .getRemotePath () + "nonEmpty.txt" ,
469+ OCUpload ocUpload = new OCUpload (FileStorageUtils .getInternalTemporalPath (account .name , targetContext )
470+ + nonEmptyFileName ,
471+ currentFolder .getRemotePath () + nonEmptyFileName ,
464472 account .name );
465473
466474 uploadOCUpload (ocUpload , FileUploader .LOCAL_BEHAVIOUR_DELETE );
467475
468- File originalFile = new File (FileStorageUtils .getTemporalPath (account .name ) + "/nonEmpty.txt" );
476+ File originalFile = new File (FileStorageUtils .getInternalTemporalPath (account .name , targetContext )
477+ + nonEmptyFileName );
469478 OCFile uploadedFile = fileDataStorageManager .getFileByDecryptedRemotePath (currentFolder .getRemotePath () +
470- "nonEmpty.txt" );
479+ nonEmptyFileName );
471480
472481 assertFalse (originalFile .exists ());
473482 assertFalse (new File (uploadedFile .getStoragePath ()).exists ());
0 commit comments