Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20d7c8dd authored by tibbi's avatar tibbi
Browse files

create parent folders at getting file output stream if needed

parent c50799a2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '4.5.5'
        propVersionName = '4.5.6'
        kotlin_version = '1.2.51'
        support_libs = '27.1.1'
    }
+4 −0
Original line number Diff line number Diff line
@@ -681,6 +681,10 @@ fun BaseSimpleActivity.getFileOutputStreamSync(path: String, mimeType: String, p
        val newDocument = documentFile.createFile(mimeType, path.getFilenameFromPath())
        applicationContext.contentResolver.openOutputStream(newDocument!!.uri)
    } else {
        if (!targetFile.parentFile.exists()) {
            targetFile.parentFile.mkdirs()
        }

        try {
            FileOutputStream(targetFile)
        } catch (e: Exception) {