com.soywiz.kproject.model.FileRefExt.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of korge-gradle-plugin-common Show documentation
Show all versions of korge-gradle-plugin-common Show documentation
Multiplatform Game Engine written in Kotlin
package com.soywiz.kproject.model
import com.soywiz.kproject.util.*
import java.io.*
import java.util.zip.*
fun unzipTo(outputDirectory: FileRef, zipFile: File) {
ZipFile(zipFile).use { zip ->
for (entry in zip.entries()) {
if (!entry.isDirectory) {
outputDirectory[entry.name.pathInfo.fullPath.trim('/')]
.writeBytes(zip.getInputStream(entry).use { it.readBytes() })
}
}
}
}