com.objectwave.simpleSockets
Class FileHandler

java.lang.Object
  |
  +--com.objectwave.simpleSockets.FileHandler
All Implemented Interfaces:
ReplyHandler

public class FileHandler
extends java.lang.Object
implements ReplyHandler

Use the class as a parameter to SimpleHTTP to create a trivial web server.

Version:
1.1
Author:
Dave Hoag

Constructor Summary
FileHandler()
           
 
Method Summary
static void main(java.lang.String[] args)
          A convienence method to start the SimpleHTTP server.
 java.io.InputStream processRequest(java.lang.String request)
          Implement the ReplyHandler interface to return a file that matches the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHandler

public FileHandler()
Method Detail

main

public static void main(java.lang.String[] args)
A convienence method to start the SimpleHTTP server. A single parameter of the port number could be provided as an argument.


processRequest

public java.io.InputStream processRequest(java.lang.String request)
Implement the ReplyHandler interface to return a file that matches the request.

Specified by:
processRequest in interface ReplyHandler
Parameters:
request - String A file name
Returns:
InputStream The file as an input stream.