ro.polak.webserver
Class HTTPResponseHeaders

java.lang.Object
  extended by ro.polak.utilities.AttributeList
      extended by ro.polak.webserver.Headers
          extended by ro.polak.webserver.HTTPResponseHeaders
All Implemented Interfaces:
java.io.Serializable

public class HTTPResponseHeaders
extends Headers

HTTP response headers representation

Java Little Web Server Homepage

Version:
1.0/21.02.2008
Author:
Piotr Polak www.polak.ro
See Also:
Serialized Form

Field Summary
static java.lang.String STATUS_ACCESS_DENIED
           
static java.lang.String STATUS_INTERNAL_SERVER_ERROR
           
static java.lang.String STATUS_METHOD_NOT_ALLOWED
           
static java.lang.String STATUS_MOVED_PERMANENTLY
           
static java.lang.String STATUS_NOT_FOUND
           
static java.lang.String STATUS_OK
           
static java.lang.String STATUS_SERVICE_UNAVAILABLE
           
 
Constructor Summary
HTTPResponseHeaders()
           
 
Method Summary
 void setContentLength(int lenght)
          Sets content length in bytes
 void setContentLength(long lenght)
          Sets content length in bytes
 void setContentType(java.lang.String contentType)
          Sets content type
 void setKeepAlive(boolean keepAlive)
          Sets keepAlive
 void setStatus(java.lang.String status)
          Sets status
 java.lang.String toString()
          String representation of headers
 
Methods inherited from class ro.polak.webserver.Headers
getHeader, getStatus, parse, setHeader
 
Methods inherited from class ro.polak.utilities.AttributeList
get, getNameAt, getValueAt, set, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_OK

public static final java.lang.String STATUS_OK
See Also:
Constant Field Values

STATUS_NOT_FOUND

public static final java.lang.String STATUS_NOT_FOUND
See Also:
Constant Field Values

STATUS_SERVICE_UNAVAILABLE

public static final java.lang.String STATUS_SERVICE_UNAVAILABLE
See Also:
Constant Field Values

STATUS_METHOD_NOT_ALLOWED

public static final java.lang.String STATUS_METHOD_NOT_ALLOWED
See Also:
Constant Field Values

STATUS_INTERNAL_SERVER_ERROR

public static final java.lang.String STATUS_INTERNAL_SERVER_ERROR
See Also:
Constant Field Values

STATUS_ACCESS_DENIED

public static final java.lang.String STATUS_ACCESS_DENIED
See Also:
Constant Field Values

STATUS_MOVED_PERMANENTLY

public static final java.lang.String STATUS_MOVED_PERMANENTLY
See Also:
Constant Field Values
Constructor Detail

HTTPResponseHeaders

public HTTPResponseHeaders()
Method Detail

setStatus

public void setStatus(java.lang.String status)
Sets status

Parameters:
status - status line

setKeepAlive

public void setKeepAlive(boolean keepAlive)
Sets keepAlive

Parameters:
keepAlive - true for keep alive connection

setContentType

public void setContentType(java.lang.String contentType)
Sets content type

Parameters:
contentType - content type

setContentLength

public void setContentLength(long lenght)
Sets content length in bytes

Parameters:
lenght - content length in bytes

setContentLength

public void setContentLength(int lenght)
Sets content length in bytes

Parameters:
lenght - content length in bytes

toString

public java.lang.String toString()
String representation of headers

Overrides:
toString in class Headers
Returns:
raw headers