cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject git commit: add the text transfer mode for CXF-5604
Date Mon, 24 Mar 2014 22:37:24 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a9ed6057d -> 20d61c8c0


add the text transfer mode for CXF-5604


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/20d61c8c
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/20d61c8c
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/20d61c8c

Branch: refs/heads/master
Commit: 20d61c8c0fafe96e372a97988eaf26f97ba8487e
Parents: a9ed605
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Mon Mar 24 23:36:38 2014 +0100
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Mon Mar 24 23:37:06 2014 +0100

----------------------------------------------------------------------
 .../websocket/atmosphere/AtmosphereWebSocketHandler.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/20d61c8c/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
index 2183e2b..9216dad 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketHandler.java
@@ -22,6 +22,7 @@ package org.apache.cxf.transport.websocket.atmosphere;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
 import java.security.Principal;
 import java.util.Enumeration;
 import java.util.List;
@@ -74,7 +75,14 @@ public class AtmosphereWebSocketHandler implements WebSocketProtocol {
     @Override
     public List<AtmosphereRequest> onMessage(WebSocket webSocket, String data) {
         LOG.info("onMessage(WebSocket, String)");
-        return null;
+        //TODO may want to use string directly instead of converting it to byte[]
+        byte[] bdata = null;
+        try {
+            bdata = data.getBytes("utf-8");
+        } catch (UnsupportedEncodingException e) {
+            // will not happen
+        }
+        return onMessage(webSocket, bdata, 0, bdata.length);
     }
 
     /** {@inheritDoc}*/


Mime
View raw message