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

org.hyperscala.web.cookie.Cookie.scala Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package org.hyperscala.web.cookie

import org.jboss.netty.handler.codec.http.DefaultCookie

/**
 * @author Matt Hicks 
 */
case class Cookie(name: String,
                  value: String,
                  comment: String = null,
                  commentUrl: String = null,
                  discard: Boolean = false,
                  domain: String = null,
                  httpOnly: Boolean = false,
                  maxAge: Int = Int.MinValue,
                  path: String = "/",
                  ports: List[Int] = Nil,
                  secure: Boolean = false,
                  version: Int = 0) {
  def toNettyCookie = {
    val c = new DefaultCookie(name, value)
    c.setComment(comment)
    c.setCommentUrl(commentUrl)
    c.setDiscard(discard)
    c.setDomain(domain)
    c.setHttpOnly(httpOnly)
    c.setMaxAge(maxAge)
    c.setPath(path)
    c.setPorts(ports: _*)
    c.setSecure(secure)
    c.setVersion(version)
    c
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy