Ensure exists directory

This commit is contained in:
M66B
2022-10-06 14:43:44 +02:00
parent bdfb324441
commit ff0f2e9ec0
12 changed files with 39 additions and 62 deletions

View File

@@ -804,9 +804,7 @@ class ImageHelper {
@NonNull
static File getCacheFile(Context context, long id, String source, String extension) {
File dir = new File(context.getFilesDir(), "images");
if (!dir.exists())
dir.mkdir();
File dir = Helper.ensureExists(new File(context.getFilesDir(), "images"));
return new File(dir, id + "_" + Math.abs(source.hashCode()) + extension);
}