java.lang.Object
raining.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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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.
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)