Return zip
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user