From 0cd0a865db445cf8854cd1eb8a7a0fce18a2f369 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 24 Jul 2019 09:58:35 +0200 Subject: [PATCH] change cache location Signed-off-by: tobiasKaminsky --- .../java/com/owncloud/android/AbstractIT.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/androidTest/java/com/owncloud/android/AbstractIT.java b/src/androidTest/java/com/owncloud/android/AbstractIT.java index 348bd69d1..0d807f9ea 100644 --- a/src/androidTest/java/com/owncloud/android/AbstractIT.java +++ b/src/androidTest/java/com/owncloud/android/AbstractIT.java @@ -52,7 +52,17 @@ public static void beforeAll() { } public String createFile(String name) throws IOException { - File tempDir = context.getFilesDir(); + File tempDir = context.getExternalCacheDir(); + + if (tempDir == null) { + throw new IOException("Temp dir is null"); + } + + if (!tempDir.exists()) { + if (!tempDir.mkdirs()) { + throw new IOException("Cannot create temp dir: " + tempDir.getAbsolutePath()); + } + } File file = new File(tempDir + File.separator + name);