com.ldodds.foafamatic.http
Class DocumentHandler

java.lang.Object
  |
  +--com.ldodds.foafamatic.http.DocumentHandler
All Implemented Interfaces:
Responder

public class DocumentHandler
extends java.lang.Object
implements Responder

Author:
ldodds

Constructor Summary
DocumentHandler(java.io.InputStream in)
           
DocumentHandler(java.lang.StringBuffer document)
           
 
Method Summary
 boolean canRespond(java.lang.String path)
           
 java.lang.String getMimeType()
           
 byte[] respond(java.lang.String path, java.util.Map parameters)
          Called by the HTTP Server to ask the object to handle the HTTP request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentHandler

public DocumentHandler(java.lang.StringBuffer document)

DocumentHandler

public DocumentHandler(java.io.InputStream in)
Method Detail

respond

public byte[] respond(java.lang.String path,
                      java.util.Map parameters)
               throws java.io.IOException
Description copied from interface: Responder
Called by the HTTP Server to ask the object to handle the HTTP request. The only context information provided is the path info and the URL parameters. No details of the user agent, etc. are provided.

Specified by:
respond in interface Responder
Parameters:
path - the path-info
parameters - the url parameters
Returns:
a byte array containing the response.
Throws:
java.io.IOException - if there were a problem handling the request, server will generate an HTTP 500 response containing the exception message

getMimeType

public java.lang.String getMimeType()
Specified by:
getMimeType in interface Responder

canRespond

public boolean canRespond(java.lang.String path)
Specified by:
canRespond in interface Responder