mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 08:08:16 +02:00
Simplification
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user