Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwest committed Feb 24, 2012
1 parent 4fd7914 commit 1c423a3
Showing 1 changed file with 8 additions and 37 deletions.
45 changes: 8 additions & 37 deletions src/main/scala/com/something/lift/NettyHttpResponse.scala
Expand Up @@ -21,52 +21,23 @@ class NettyHttpResponse(ctx: ChannelHandlerContext) extends HTTPResponse {
r
}

/**
* Add cookies to the response
*
* @param cookies - the list of response cookies
*/
def addCookies(cookies: List[HTTPCookie]) {} // FIXME // throw new Exception("Implement me")
// FIXME actually add cookies to the response
def addCookies(cookies: List[HTTPCookie]) {}

/**
* Encodes the URL such that it adds the session ID if it is necessary to the URL.
* It is implementation specific detail how/if to add the session informations. This will be used
* for URL rewriting purposes.
*
* @param url - the URL that needs to be analysed
*/
// FIXME add session id if/when sessions are supported?
def encodeUrl(url: String): String = url

/**
* Add a list of header parameters to the response object
*
* @param headers - the list of headers
*/
def addHeaders(headers: List[HTTPParam]) {} // FIXME // throw new Exception("Implement me")
// FIXME actually set headers
def addHeaders(headers: List[HTTPParam]) {}

/**
* Sets the HTTP response status
*
* @param status - the HTTP status
*/
def setStatus(status: Int) = nettyResponse.setStatus(HttpResponseStatus.valueOf(status)) //throw new Exception("Implement me")
def setStatus(status: Int) = nettyResponse.setStatus(HttpResponseStatus.valueOf(status))

/**
* Returns the HTTP response status that has been set with setStatus
* */
def getStatus: Int = nettyResponse.getStatus.getCode

/**
* Sets the HTTP response status
*
* @param status - the HTTP status
* @param reason - the HTTP reason phrase
*/
// FIXME
def setStatusWithReason(status: Int, reason: String) = throw new Exception("Implement me")

/**
* @return - the OutputStream that can be used to send down o the client the response body.
*/
// TODO make better: ovverride other write methods, better flush
def outputStream: OutputStream = new OutputStream {
// TODO: there is a probably a better impl, by override the other write methods.
def write(i: Int) {
Expand Down

0 comments on commit 1c423a3

Please sign in to comment.