From acdf63c7d98676a69377ddebfb743af2f80c5c1a Mon Sep 17 00:00:00 2001 From: Vishal Nehra Date: Sun, 13 Aug 2023 04:14:00 +0530 Subject: [PATCH] Add trash bin directory check --- trashbin/src/main/java/com/amaze/trashbin/TrashBinConfig.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trashbin/src/main/java/com/amaze/trashbin/TrashBinConfig.kt b/trashbin/src/main/java/com/amaze/trashbin/TrashBinConfig.kt index 3109e40..275f3c0 100644 --- a/trashbin/src/main/java/com/amaze/trashbin/TrashBinConfig.kt +++ b/trashbin/src/main/java/com/amaze/trashbin/TrashBinConfig.kt @@ -55,6 +55,10 @@ data class TrashBinConfig( } fun getMetaDataFilePath(): String { + val baseDir = File(basePath) + if (!baseDir.exists()) { + baseDir.mkdirs() + } val file = File(basePath, TRASH_BIN_META_FILE) if (!file.exists()) { file.createNewFile()