All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.soywiz.kproject.model.FileRefExt.kt Maven / Gradle / Ivy

There is a newer version: 6.0.0-beta4
Show newest version
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() })
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy