From 95630b68b9e86ec75039faa71d9fe47ab5357c29 Mon Sep 17 00:00:00 2001 From: Yasara Dissanayake Date: Tue, 1 Aug 2017 22:32:55 +0530 Subject: [PATCH] Update Sample 10 for proper display --- .../java/org/wso2/sp/http/server/HttpServerListener.java | 1 - .../wso2/sp/http/server/HttpServerListenerHandler.java | 2 +- .../java/org/wso2/sp/http/server/HttpServerMain.java | 9 ++++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerListener.java b/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerListener.java index 6cf826f43..903a1bfa3 100644 --- a/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerListener.java +++ b/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerListener.java @@ -51,7 +51,6 @@ public void handle(HttpExchange t) throws IOException { strBld = new StringBuilder(); while ((line = in.readLine()) != null) { strBld = strBld.append(line).append("\n"); - System.out.print(line + "\n"); } logger.info("Event Arrived: " + strBld.toString()); diff --git a/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerListenerHandler.java b/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerListenerHandler.java index cb7ecd907..b7a2d89fd 100644 --- a/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerListenerHandler.java +++ b/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerListenerHandler.java @@ -58,7 +58,7 @@ public void run() { } - public void shutdown() { + void shutdown() { if (server != null) { server.stop(1); } diff --git a/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerMain.java b/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerMain.java index c89d7ca94..28957f6a5 100644 --- a/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerMain.java +++ b/modules/samples/sample-clients/http-server/src/main/java/org/wso2/sp/http/server/HttpServerMain.java @@ -1,5 +1,11 @@ package org.wso2.sp.http.server; +import com.sun.net.httpserver.Headers; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + /** * This is a sample HTTP server to receive events through HTTP/HTTPS protocol */ @@ -13,7 +19,8 @@ public static void main(String[] args) throws InterruptedException { Thread.sleep(100); } logger.info("Received Event :" + lst.getServerListner().getData()); - logger.info("Received Event Headers :" + lst.getServerListner().getHeaders().toString()); + logger.info("Received Event Headers key set:" + lst.getServerListner().getHeaders().keySet().toString()); + logger.info("Received Event Headers value set:" + lst.getServerListner().getHeaders().values().toString()); lst.shutdown(); } }