Servlet[] servlets) throws IOException { this(documentRootDirectory, port, "index.html"); servletNamed = new HashMap(); for(int i = 0; i < servlets.length; i++) servletNamed.put("/" + servlets[i].name(), servlets[i]);
String indexFileName) throws IOException {  this.documentRootDirectory = documentRootDirectory == null ? new File(".") : documentRootDirectory;  if (!this.documentRootDirectory.isDirectory()) { throw new IOException(this.documentRootDirectory + " does not exist as a directory"); } this.indexFileName = indexFileName; this.server = new ServerSocket(port);
    public HTTPServer(File documentRootDirectory,                      int port,                       Servlet[] servlets) throws IOException {        this(documentRootDirectory, port, "index.html");        servletNamed = new HashMap();        for(int i = 0; i < servlets.length; i++)            servletNamed.put("/" + servlets[i].name(), servlets[i]);    }