Savarese.Org

org.savarese.barehttp
Class Main

java.lang.Object
  extended by org.savarese.barehttp.Main

public final class Main
extends java.lang.Object

The BareHTTP server, a sample program that starts an HTTPServer instance. The program expects two arguments: a port number and a fully-qualified directory pathname specifying the document root. It could easily be expanded to allow the specification of a binding address and maximum number of connections.

Author:
Daniel F. Savarese

Method Summary
static void main(java.lang.String[] args)
          Starts an HTTPServer instance on a specified port allowing HTTPServer.DEFAULT_MAX_CONNECTIONS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Starts an HTTPServer instance on a specified port allowing HTTPServer.DEFAULT_MAX_CONNECTIONS. No provisions are made for terminating the program. The program must be terminated by SIGKILL, Ctrl-C, or whatever OS-specific mechanism exists to kill a running process.

Parameters:
args - The program arguments: a port number and document root directory. The root directory is converted to a canonical path prior to starting the server.
Throws:
java.lang.Exception - if the HTTPServer cannot be instantiated or started.
java.io.IOException

Savarese.Org

Copyright © 2001,2006,2010,2012 Daniel F. Savarese. All Rights Reserved.