Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

raining.protocol.http
Class Http304Response  view Http304Response download Http304Response.java

java.lang.Object
  extended byraining.protocol.http.Http304Response
All Implemented Interfaces:
raining.core.Response

public class Http304Response
extends java.lang.Object
implements raining.core.Response

Class representing a request (non GET) our server doesnt understand.


Field Summary
(package private) static byte[] content
           
static java.lang.String contentType
           
static java.lang.String CRLF
           
static java.lang.String CRLF2
           
static java.lang.String HTTP_VERSION
           
static java.lang.String P
           
protected static java.lang.String scontent
           
(package private) static java.lang.String sheader
           
 
Constructor Summary
Http304Response(raining.core.Request request)
          ctor that takes a request object.
 
Method Summary
 byte[] getBytes()
          Return as a stream of bytes.
static byte[] getStaticContent()
          Returns a static 503 string to be used, when a server is reaching capacity, and wants to reject connections with a reply.
 java.lang.String getString()
          return content as a String: to start with we use this, this does a conversion 3 times, so avoid.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

content

static byte[] content

sheader

static java.lang.String sheader

HTTP_VERSION

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

CRLF

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

CRLF2

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

contentType

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

scontent

protected static final java.lang.String scontent
See Also:
Constant Field Values

P

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

Http304Response

public Http304Response(raining.core.Request request)
ctor that takes a request object. Usually the URL would be used in the reply, and logged. Currently a static response is returned.

Method Detail

getBytes

public byte[] getBytes()
Return as a stream of bytes. Preferred since we can use bytes throughout and avoid costly string to byte conversions.

Specified by:
getBytes in interface raining.core.Response

getString

public java.lang.String getString()
return content as a String: to start with we use this, this does a conversion 3 times, so avoid.

Specified by:
getString in interface raining.core.Response

getStaticContent

public static byte[] getStaticContent()
Returns a static 503 string to be used, when a server is reaching capacity, and wants to reject connections with a reply.


main

public static void main(java.lang.String[] args)