InetSocketAddress addr = new InetSocketAddress (0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
ExecutorService executor = Executors.newCachedThreadPool();
server.setExecutor (executor);
server.start ();
URL url = new URL ("http://localhost:"+server.getAddress().getPort()+"/test/foo.html");
System.out.print ("Test8: " );
HttpURLConnection urlc = (HttpURLConnection)url.openConnection ();
urlc.setDoOutput (true);