Skip to content

Commit

Permalink
Minor fix while creating init files
Browse files Browse the repository at this point in the history
  • Loading branch information
VishalNehra committed Jul 23, 2023
1 parent eb2c176 commit 5b90339
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions trashbin/src/main/java/com/amaze/trashbin/TrashBinConfig.kt
Expand Up @@ -43,15 +43,19 @@ data class TrashBinConfig(
}

fun getTrashBinFilesDirectory(): String {
val directory = File(basePath + File.separator + TRASH_BIN_DIR)
val baseDir = File(basePath)
if (!baseDir.exists()) {
baseDir.mkdirs()
}
val directory = File(basePath, TRASH_BIN_DIR)
if (!directory.exists()) {
directory.mkdirs()
}
return basePath + File.separator + TRASH_BIN_DIR
}

fun getMetaDataFilePath(): String {
val file = File(basePath + File.separator + TRASH_BIN_META_FILE)
val file = File(basePath, TRASH_BIN_META_FILE)
if (!file.exists()) {
file.createNewFile()
}
Expand Down

0 comments on commit 5b90339

Please sign in to comment.