com.faunos.util.net.http
Class CannedResponses

java.lang.Object
  extended by com.faunos.util.net.http.CannedResponses

public class CannedResponses
extends Object

A collection of canned HTTP responses. The buffer fields are read-only.

Author:
Babak Farhang
See Also:
ImmutableBuffer

Field Summary
 ImmutableBuffer allow
          "Allow: "
 ImmutableBuffer allowGetHead
          "Allow: GET, HEAD" + CRLF
 ImmutableBuffer appOctet
          application/octet-stream + CRLF
 ImmutableBuffer badRequest
          The 400 status line.
 ImmutableBuffer connectionClose
          "Connection: close" + CRLF
 ImmutableBuffer contentBase
          "Content-Location: "
 ImmutableBuffer contentLength
          "Content-Length: "
 ImmutableBuffer contentLocation
          "Content-Location: "
 ImmutableBuffer contentType
          "Content-Type: "
 ImmutableBuffer emptyLine
          Returns an empty line (CRLF).
 ImmutableBuffer forbidden
          The 403 status line.
 ImmutableBuffer imageGif
          image/gif + CRLF
 ImmutableBuffer imageIco
          image/x-icon + CRLF
 ImmutableBuffer imageJpeg
          image/jpeg + CRLF
 ImmutableBuffer imagePng
          image/png + CRLF
 ImmutableBuffer location
          "Location: "
 ImmutableBuffer methodNotAllowed
          The 405 status line.
 ImmutableBuffer notFound
          The 404 status line.
 ImmutableBuffer notImplemented
          The 501 status line.
 ImmutableBuffer okay
          The 200 status line.
 ImmutableBuffer plainText
          text/plain + CRLF
 ImmutableBuffer requestUriTooLong
          The 414 status line.
 ImmutableBuffer server
          "Server: "
 ImmutableBuffer serverError
          The 500 status line.
 ImmutableBuffer textCss
          text/html + CRLF
 ImmutableBuffer textHtml
          text/html + CRLF
 ImmutableBuffer textXml
          text/xml + CRLF
 
Constructor Summary
protected CannedResponses(String version)
           
 
Method Summary
static ImmutableBuffer createBuffer(String content)
           
 Map<String,ImmutableBuffer> getNameMap()
           
 Map<String,ImmutableBuffer> getValueMap()
           
static CannedResponses newHttp10()
           
static CannedResponses newHttp11()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

okay

public final ImmutableBuffer okay
The 200 status line.


notImplemented

public final ImmutableBuffer notImplemented
The 501 status line.


notFound

public final ImmutableBuffer notFound
The 404 status line.


badRequest

public final ImmutableBuffer badRequest
The 400 status line.


requestUriTooLong

public final ImmutableBuffer requestUriTooLong
The 414 status line.


methodNotAllowed

public final ImmutableBuffer methodNotAllowed
The 405 status line.


forbidden

public final ImmutableBuffer forbidden
The 403 status line.


serverError

public final ImmutableBuffer serverError
The 500 status line.


allowGetHead

public final ImmutableBuffer allowGetHead
"Allow: GET, HEAD" + CRLF


connectionClose

public final ImmutableBuffer connectionClose
"Connection: close" + CRLF


contentType

public final ImmutableBuffer contentType
"Content-Type: "


contentLength

public final ImmutableBuffer contentLength
"Content-Length: "


allow

public final ImmutableBuffer allow
"Allow: "


server

public final ImmutableBuffer server
"Server: "


contentLocation

public final ImmutableBuffer contentLocation
"Content-Location: "


contentBase

public final ImmutableBuffer contentBase
"Content-Location: "


location

public final ImmutableBuffer location
"Location: "


textHtml

public final ImmutableBuffer textHtml
text/html + CRLF


textCss

public final ImmutableBuffer textCss
text/html + CRLF


textXml

public final ImmutableBuffer textXml
text/xml + CRLF


plainText

public final ImmutableBuffer plainText
text/plain + CRLF


appOctet

public final ImmutableBuffer appOctet
application/octet-stream + CRLF


imagePng

public final ImmutableBuffer imagePng
image/png + CRLF


imageGif

public final ImmutableBuffer imageGif
image/gif + CRLF


imageJpeg

public final ImmutableBuffer imageJpeg
image/jpeg + CRLF


imageIco

public final ImmutableBuffer imageIco
image/x-icon + CRLF


emptyLine

public final ImmutableBuffer emptyLine
Returns an empty line (CRLF).

Constructor Detail

CannedResponses

protected CannedResponses(String version)
Method Detail

getNameMap

public final Map<String,ImmutableBuffer> getNameMap()

getValueMap

public final Map<String,ImmutableBuffer> getValueMap()

newHttp11

public static CannedResponses newHttp11()

newHttp10

public static CannedResponses newHttp10()

createBuffer

public static ImmutableBuffer createBuffer(String content)


SourceForge.net Logo