Hitman.HTTP
Class Server

java.lang.Object
  extended by Hitman.HTTP.Server

public class Server
extends java.lang.Object

Simple HTTP daemon


Nested Class Summary
private static class Server.ListenThread
          Private listen thread
 
Field Summary
private static java.lang.String www_root
          Document root
 
Constructor Summary
Server()
           
 
Method Summary
private static void error(java.io.BufferedWriter out, short errcode)
          Handle errors
private static void handle_cgi(java.io.BufferedWriter out, java.io.File cgi)
          Handle a CGI call request
static void main(java.lang.String[] args)
          Main program
private static void reply(java.io.BufferedWriter out, java.io.File file)
          Reply to a GET request
private static void reply(java.io.BufferedWriter out, java.lang.String cntType, java.lang.String cnt)
          Reply to a POST request
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

www_root

private static java.lang.String www_root
Document root

Constructor Detail

Server

public Server()
Method Detail

error

private static void error(java.io.BufferedWriter out,
                          short errcode)
                   throws java.io.IOException
Handle errors

Parameters:
out - Output stream
errcode - Error code
Throws:
java.io.IOException

reply

private static void reply(java.io.BufferedWriter out,
                          java.lang.String cntType,
                          java.lang.String cnt)
                   throws java.io.IOException
Reply to a POST request

Parameters:
out - Output stream
cntType - Content type
cnt - Content
Throws:
java.io.IOException

reply

private static void reply(java.io.BufferedWriter out,
                          java.io.File file)
                   throws java.io.IOException
Reply to a GET request

Parameters:
out - Output stream
file - Requested file
Throws:
java.io.IOException

handle_cgi

private static void handle_cgi(java.io.BufferedWriter out,
                               java.io.File cgi)
                        throws java.io.IOException
Handle a CGI call request

Parameters:
out - Output stream
cgi - CGI to call
Throws:
java.io.IOException

main

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