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

org.scalatra.servlet.MultipartConfig.scala Maven / Gradle / Ivy

The newest version!
package org.scalatra.servlet

import org.scalatra.ServletCompat.{ MultipartConfigElement, ServletContext }

case class MultipartConfig(
  location: Option[String] = None,
  maxFileSize: Option[Long] = None,
  maxRequestSize: Option[Long] = None,
  fileSizeThreshold: Option[Int] = None) extends MountConfig {

  def toMultipartConfigElement = {
    new MultipartConfigElement(
      location.getOrElse(""),
      maxFileSize.getOrElse(-1),
      maxRequestSize.getOrElse(-1),
      fileSizeThreshold.getOrElse(0))
  }

  def apply(ctxt: ServletContext): Unit = {
    ctxt.setAttribute(HasMultipartConfig.MultipartConfigKey, this)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy