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

Quick Search    Search Deep

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

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

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

Interface for Response, including response header creation. Remember that headers need to b cached as does data. TODO. I need to refactor this. only the 404 200 resp code differs.


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
Http404Response(raining.core.Request request)
          ctor that takes a request object.
 
Method Summary
 byte[] getBytes()
          Return as a stream of bytes.
 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

Http404Response

public Http404Response(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

main

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