You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by wt...@apache.org on 2009/03/13 03:04:36 UTC

svn commit: r753088 - in /camel/branches/camel-1.x: ./ components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java

Author: wtam
Date: Fri Mar 13 02:04:34 2009
New Revision: 753088

URL: http://svn.apache.org/viewvc?rev=753088&view=rev
Log:
Merged revisions 753087 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r753087 | wtam | 2009-03-12 22:02:14 -0400 (Thu, 12 Mar 2009) | 1 line
  
  apply patch on Nolan's behalf to set response charset reading from exchange
........

Modified:
    camel/branches/camel-1.x/   (props changed)
    camel/branches/camel-1.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 13 02:04:34 2009
@@ -1 +1 @@
-/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956
+/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749936,749956,750017,750334,750396,750761,750796,752068,752117,752418,752751-752755,752764-752773,752956,753087

Propchange: camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-1.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java?rev=753088&r1=753087&r2=753088&view=diff
==============================================================================
--- camel/branches/camel-1.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java (original)
+++ camel/branches/camel-1.x/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java Fri Mar 13 02:04:34 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.Parameter;
@@ -186,7 +187,7 @@
         } else {
             out = exchange.getOut();
         }
-        
+             
         // get content type
         MediaType mediaType = out.getHeader(RestletConstants.MEDIA_TYPE, MediaType.class);
         if (mediaType == null) {
@@ -221,6 +222,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)));
+        } 
     }
 
     /**