com.prolixtech.jaminid
Class Response
java.lang.Object
com.prolixtech.jaminid.Response
public class Response
extends java.lang.Object
The response class encapsulates an HTTP response. It contains the response
data (headers, etc) as well as functions to publish cookies, send files, etc.
Response
public Response(int statusCode,
Protocol protocol,
OutputStream out,
Request masterRequest)
publishHeader
public void publishHeader()
throws IOException
Sends the header to the client. After this, no more headers can be set,
no more cookies can be send
sendCookie15DG
public void sendCookie15DG(String name,
String value)
sets a fifteen day cookie
name
- the field namevalue
- the field value
sendFile
public void sendFile(File cFile)
throws Exception
sends a file to the client. Sets the MIME type accordingly
setCookie
public void setCookie(String name,
String value,
String path,
Date expires)
sets a cookie
name
- the field namevalue
- the field vaLUEpath
- the relevant pathexpires
- the cookie activation day
setHeaderLine
public void setHeaderLine(ProtocolResponseHeader header,
String value)
sets one particular header line
setStatus
public void setStatus(int statusCode)
sets the status of the response to a certain HTTP status code
statusCode
- the code to set the status to