1
0

Return zip

This commit is contained in:
2020-09-10 19:03:24 +02:00
parent 883610878a
commit ddf8558578
4 changed files with 19 additions and 5 deletions
@@ -0,0 +1,3 @@
package starter.utils
fun sanitizeFilename(inputName: String): String = inputName.replace("[^a-zA-Z0-9-_.]".toRegex(), "_")
@@ -12,6 +12,8 @@ class ZipOutput(name: String) : AutoCloseable {
createNewFile()
}
private val outputStream = ZipArchiveOutputStream(zipFile.outputStream())
val name: String
get() = zipFile.name
fun write(path: String, content: String) {
val entry = ZipArchiveEntry(path)