public class Response
extends java.lang.Object
Constructor and Description |
---|
Response(int statusCode,
Protocol protocol,
java.io.OutputStream out,
Request masterRequest) |
Modifier and Type | Method and Description |
---|---|
byte[] |
CRLF() |
void |
publishHeader()
Sends the header to the client.
|
void |
sendCookie15DG(java.lang.String name,
java.lang.String value)
sets a fifteen day cookie
|
void |
sendFile(java.io.File cFile)
sends a file to the client.
|
void |
setCookie(java.lang.String name,
java.lang.String value,
java.lang.String path,
java.util.Date expires)
sets a cookie
|
void |
setHeaderLine(ProtocolResponseHeader header,
java.lang.String value)
sets one particular header line
|
void |
setStatus(int statusCode)
sets the status of the response to a certain HTTP status code
|
public void setStatus(int statusCode)
statusCode
- the code to set the status topublic void sendCookie15DG(java.lang.String name, java.lang.String value)
name
- the field namevalue
- the field valuepublic void setCookie(java.lang.String name, java.lang.String value, java.lang.String path, java.util.Date expires)
name
- the field namevalue
- the field vaLUEpath
- the relevant pathexpires
- the cookie activation daypublic void publishHeader() throws java.io.IOException
java.io.IOException
public void setHeaderLine(ProtocolResponseHeader header, java.lang.String value)
header
- value
- public byte[] CRLF()
public void sendFile(java.io.File cFile) throws java.lang.Exception
cFile
- the file to sendjava.io.IOException
java.lang.Exception