/**
 * @license
 * Copyright 2017 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

package foam.nanos.http;

import com.sun.net.httpserver.*;
import java.io.*;
import java.util.Date;

public class PingService
  implements HttpHandler
{
  public PingService() {}

  @Override
  public void handle(HttpExchange t) throws IOException {
    System.out.println("Pong");
    String response = "Pong: " + new Date();
    t.sendResponseHeaders(200, response.length());
    OutputStream os = t.getResponseBody();
    os.write(response.getBytes());
    os.close();
  }
}

@@ -154,30 +154,17 @@
 ort 
-com.sun.net.httpserver
+foam.core
 .*;%0A
@@ -178,17 +178,27 @@
 java.io.
-*
+PrintWriter
 ;%0Aimport
@@ -257,19 +257,16 @@
 nts 
-HttpHandler
+WebAgent
 %0A%7B%0A 
@@ -321,272 +321,109 @@
 oid 
-handle(HttpExchange t) throws IOException %7B%0A    System.out.println(%22Pong%22);%0A    String response = %22Pong: %22 + new Date();%0A    t.sendResponseHeaders(200, response.length());%0A    OutputStream os = t.getResponseBody();%0A    os.write(response.getBytes());%0A    os.clos
+execute(X x) %7B%0A    PrintWriter out = x.get(PrintWriter.class);%0A    out.println(%22Pong: %22 + new Dat
 e()
+)
 ;%0A  

Fix PingService by making a WebAgent.