Hi ! I'm trying to zip a folder recursevily with O...
# squarelibraries
l
Hi ! I'm trying to zip a folder recursevily with Okio and Kotlin, but the produced zip has nothing in it. Code in 🧵
compress folder recursively.kt
j
If you have access to ZipOutputStream is there a reason to use Okio? You could create a new nio zip FileSystem in a new file, get it's root nio Path, and then use https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io.path/java.nio.file.-path/copy-to-recursively.html and be done in like 3 lines.
l
Thank you. I was just using Okio because I added it in my project for handling file system more easily. I'll have a look at your link right now 😃
j
I'll be at a computer soon. I'll figure out what's wrong with the original code and show you the (arguably superior) NIO code
👍 1
l
Thank you very much 🙂
I've tried a code like this, but it doesn't work. It fails saying that the zip file already exists.