camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r753087 - /camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
Date Fri, 13 Mar 2009 02:02:15 GMT
Author: wtam
Date: Fri Mar 13 02:02:14 2009
New Revision: 753087

URL: http://svn.apache.org/viewvc?rev=753087&view=rev
Log:
apply patch on Nolan's behalf to set response charset reading from exchange

Modified:
    camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java

Modified: camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java?rev=753087&r1=753086&r2=753087&view=diff
==============================================================================
--- camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
(original)
+++ camel/trunk/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
Fri Mar 13 02:02:14 2009
@@ -33,6 +33,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.restlet.data.ChallengeResponse;
 import org.restlet.data.ChallengeScheme;
+import org.restlet.data.CharacterSet;
 import org.restlet.data.Form;
 import org.restlet.data.MediaType;
 import org.restlet.data.Request;
@@ -181,7 +182,7 @@
         } else {
             out = exchange.getOut();
         }
-        
+             
         // get content type
         MediaType mediaType = out.getHeader(RestletConstants.RESTLET_MEDIA_TYPE, MediaType.class);
         if (mediaType == null) {
@@ -215,6 +216,11 @@
             LOG.debug("Populate Restlet response from exchange body: " + text);
         }
         response.setEntity(text, mediaType);
+        
+        if (exchange.getProperty(Exchange.CHARSET_NAME) != null) {
+            response.getEntity().setCharacterSet(CharacterSet.valueOf(exchange.getProperty(Exchange.CHARSET_NAME,

+                                                                                        
  String.class)));
+        } 
     }
 
     /**



Mime
View raw message