org.ow2.jonas.web.base.proxy
Class HTTPResponse

java.lang.Object
  extended by org.ow2.jonas.web.base.proxy.HTTPResponse

public class HTTPResponse
extends Object

Allows to define some HTTP response

Author:
Florent Benoit

Constructor Summary
HTTPResponse()
          Build a new object with the default status code.
HTTPResponse(String statusCode)
          Build an answer with the given status code.
 
Method Summary
 byte[] getContent()
          Gets the array of bytes of this answer.
 void print(String string)
          Append text into the body.
 void println(String string)
          Append text into the body.
 void setBodyBytes(byte[] bodyBytes)
           
 void setContentType(String contentType)
           
 void setRefresh(boolean refresh)
          Refresh mode is enabled or disabled.
 void setTitle(String title)
          Sets the title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPResponse

public HTTPResponse()
Build a new object with the default status code.


HTTPResponse

public HTTPResponse(String statusCode)
Build an answer with the given status code.

Parameters:
statusCode - given code
Method Detail

setTitle

public void setTitle(String title)
Sets the title.

Parameters:
title - given HTML title

println

public void println(String string)
Append text into the body.

Parameters:
string - the given string object

print

public void print(String string)
Append text into the body.

Parameters:
string - the given string object

setRefresh

public void setRefresh(boolean refresh)
Refresh mode is enabled or disabled.

Parameters:
refresh - if true, send in the answer a refresh code

getContent

public byte[] getContent()
Gets the array of bytes of this answer.

Returns:
the bytes of the answer

setContentType

public void setContentType(String contentType)

setBodyBytes

public void setBodyBytes(byte[] bodyBytes)


Copyright © 2010 OW2 Consortium. All Rights Reserved.