Skip to content

Commit

Permalink
Update Sample 10 for proper display
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasara Dissanayake committed Aug 1, 2017
1 parent 44323f0 commit 95630b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void run() {

}

public void shutdown() {
void shutdown() {
if (server != null) {
server.stop(1);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
*/
Expand All @@ -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();
}
}
Expand Down

0 comments on commit 95630b6

Please sign in to comment.