create a directory at decompressing, if needed
This commit is contained in:
parent
a14919d6d9
commit
09345dba49
1 changed files with 12 additions and 1 deletions
|
@ -100,7 +100,18 @@ class DecompressActivity : SimpleActivity() {
|
||||||
while (true) {
|
while (true) {
|
||||||
val entry = zipInputStream.nextEntry ?: break
|
val entry = zipInputStream.nextEntry ?: break
|
||||||
val filename = title.toString().substringBeforeLast(".")
|
val filename = title.toString().substringBeforeLast(".")
|
||||||
val newPath = "$destination/$filename/${entry.name.trimEnd('/')}"
|
val parent = "$destination/$filename"
|
||||||
|
val newPath = "$parent/${entry.name.trimEnd('/')}"
|
||||||
|
|
||||||
|
if (!getDoesFilePathExist(parent)) {
|
||||||
|
if (!createDirectorySync(parent)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entry.isDirectory) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
val fos = getFileOutputStreamSync(newPath, newPath.getMimeType())
|
val fos = getFileOutputStreamSync(newPath, newPath.getMimeType())
|
||||||
var count: Int
|
var count: Int
|
||||||
|
|
Loading…
Reference in a new issue