Simplification

This commit is contained in:
M66B
2023-12-12 18:21:23 +01:00
parent 8482338f2b
commit 125a47efd8
13 changed files with 27 additions and 26 deletions

View File

@@ -2641,17 +2641,18 @@ public class Helper {
private static final Map<File, Boolean> exists = new HashMap<>();
static File ensureExists(File dir) {
static File ensureExists(File parent, String subdir) {
parent.mkdir();
File dir = new File(parent, subdir);
dir.mkdir();
synchronized (exists) {
if (exists.containsKey(dir))
return dir;
exists.put(dir, true);
}
// CASA: External storage as well
if (!dir.exists() && Log.jni_safe_mkdirs(dir))
throw new IllegalArgumentException("Failed to create directory");
return dir;
}