create Folder app - Android
This commit is contained in:
parent
6dd58b8bb3
commit
01d44d6b42
1 changed files with 13 additions and 2 deletions
|
|
@ -2,8 +2,19 @@ package mg.dot.feufaro
|
|||
|
||||
import android.content.Context
|
||||
import org.koin.core.context.GlobalContext
|
||||
import java.io.File
|
||||
|
||||
actual fun getConfigDirectoryPath(): String {
|
||||
val context = GlobalContext.get().get<Context>()
|
||||
return context.filesDir.absolutePath
|
||||
val baseDir = GlobalContext.get().get<Context>().filesDir
|
||||
val feufa2Folder = File(baseDir, "Feufaro")
|
||||
|
||||
if (!feufa2Folder.exists()) {
|
||||
val created = feufa2Folder.mkdirs()
|
||||
if (created) {
|
||||
println("CP:15: Dossier créé avec succès : ${feufa2Folder.absolutePath}")
|
||||
}
|
||||
}
|
||||
|
||||
val path = feufa2Folder.absolutePath
|
||||
return if (path.endsWith(File.separator)) path else path + File.separator
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue