https://kotlinlang.org logo
#javalin
Title
# javalin
a

asad.awadia

01/31/2021, 10:46 PM
t

tipsy

02/01/2021, 6:00 AM
what are you wondering?
a

asad.awadia

02/01/2021, 9:33 PM
do you see any obvious flaws? any better ways of doing this?
Copy code
private fun downloadBackup(ctx: Context) {
    ctx.result(Files.readAllBytes(Path.of("/tmp/backup.zip")))
  }
also this piece - is this how static files are sent as well? Just read the bytes and send it as a result? or are there optimisations that you use when sending static files
t

tipsy

02/02/2021, 1:14 PM
no, static files are handled completely by jetty
it's pretty complex
but doing what you did should be fine too
i don't really want to "bless" application logic though
a

asad.awadia

02/02/2021, 1:34 PM
Ok ok np thanks!
8 Views