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

spice.http.server.rest.FileUpload.scala Maven / Gradle / Ivy

There is a newer version: 0.5.14
Show newest version
package spice.http.server.rest

import fabric.define.DefType
import fabric.obj
import fabric.rw._
import spice.http.Headers

import java.io.File

case class FileUpload(fileName: String, file: File, headers: Headers)

object FileUpload {
  implicit val rw: RW[FileUpload] = RW.from[FileUpload](
    r = f => obj().withReference(f),
    w = json => json.reference.getOrElse(throw new RuntimeException("No reference for FileUpload")).asInstanceOf[FileUpload],
    d = DefType.Obj(Some("spice.http.server.rest.FileUpload"))
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy