You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2008/01/08 21:23:48 UTC

svn commit: r610130 - in /incubator/cxf/branches/2.0.x-fixes: ./ maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/ rt/transports/http/src/main/java/org/apache/cxf/transport/http/ tools/common/src/main/java/org/ap...

Author: dkulp
Date: Tue Jan  8 12:23:46 2008
New Revision: 610130

URL: http://svn.apache.org/viewvc?rev=610130&view=rev
Log:
Merged revisions 609658 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r609658 | dkulp | 2008-01-07 11:07:30 -0500 (Mon, 07 Jan 2008) | 3 lines
  
  [CXF-1276, CXF-1346] Fix issues with contentEncoding in HttpConduit
  Turn off velocity.log.  (Someone can hook this up to the -verbose switch if they want to.   I don't really see the point right now)
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java
    incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
    incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
    incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java?rev=610130&r1=610129&r2=610130&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java Tue Jan  8 12:23:46 2008
@@ -104,7 +104,7 @@
     }
 
     private void generatePluginXML(List<File> jars) throws Exception {
-        VelocityGenerator velocity = new VelocityGenerator();
+        VelocityGenerator velocity = new VelocityGenerator(false);
 
         String templateFile = getTemplateFile(ECLIPSE_VERSION);
 

Modified: incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=610130&r1=610129&r2=610130&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Tue Jan  8 12:23:46 2008
@@ -1918,17 +1918,20 @@
             inMessage.put(Message.RESPONSE_CODE, responseCode);
             String ct = connection.getContentType();
             inMessage.put(Message.CONTENT_TYPE, ct);
-            String enc = connection.getContentEncoding();
-            if (enc == null 
-                && ct != null 
+            String charset = null;
+            if (ct != null 
                 && ct.indexOf("charset") != -1) {
-                enc = ct.substring(ct.indexOf("charset") + 8);
-                if (enc.indexOf(";") != -1) {
-                    enc = enc.substring(0, enc.indexOf(";"));
+                charset = ct.substring(ct.indexOf("charset") + 8);
+                if (charset.indexOf(";") != -1) {
+                    charset = charset.substring(0, charset.indexOf(";"));
                 }
             }
+            String enc = connection.getContentEncoding();
+            if (charset == null) {
+                charset = enc;
+            }
             
-            String normalizedEncoding = HttpHeaderHelper.mapCharset(enc);
+            String normalizedEncoding = HttpHeaderHelper.mapCharset(charset);
             if (normalizedEncoding == null) {
                 String m = new org.apache.cxf.common.i18n.Message("INVALID_ENCODING_MSG",
                                                                    LOG, enc).toString();

Modified: incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java?rev=610130&r1=610129&r2=610130&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java Tue Jan  8 12:23:46 2008
@@ -38,6 +38,7 @@
 import org.apache.velocity.Template;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.Velocity;
+import org.apache.velocity.runtime.RuntimeConstants;
 
 public final class VelocityGenerator {
     private static final Logger LOG = LogUtils.getL7dLogger(VelocityGenerator.class);
@@ -45,11 +46,10 @@
     private String baseDir;
     
     public VelocityGenerator() {
-        init();
+        this(false);
     }
-
-    private void init() {
-        initVelocity();
+    public VelocityGenerator(boolean log) {
+        initVelocity(log);
     }
 
     private String getVelocityLogFile(String logfile) {
@@ -60,14 +60,17 @@
         return logdir + File.separator + logfile;
     }
 
-    private void initVelocity() throws ToolException {
+    private void initVelocity(boolean log) throws ToolException {
         try {
             Properties props = new Properties();
             String clzName = "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader";
             props.put("resource.loader", "class");
             props.put("class.resource.loader.class", clzName);
             props.put("runtime.log", getVelocityLogFile("velocity.log"));
-
+            if (!log) {
+                props.put(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, 
+                          "org.apache.velocity.runtime.log.NullLogSystem");
+            }
             Velocity.init(props);
         } catch (Exception e) {
             org.apache.cxf.common.i18n.Message msg =

Modified: incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java?rev=610130&r1=610129&r2=610130&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java Tue Jan  8 12:23:46 2008
@@ -61,7 +61,7 @@
     }
 
     public void generateAndCompile(Collection<JavaClass> wrapperClasses, File dir) {
-        VelocityGenerator generator = new VelocityGenerator();
+        VelocityGenerator generator = new VelocityGenerator(false);
         generator.setBaseDir(dir.toString());
 
         List<File> generatedFiles = new ArrayList<File>();

Modified: incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java?rev=610130&r1=610129&r2=610130&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java Tue Jan  8 12:23:46 2008
@@ -72,7 +72,7 @@
         File xjb = getJAXBCustFile(outputdir);
 
         if (dateType != null) {
-            VelocityGenerator generator = new VelocityGenerator();
+            VelocityGenerator generator = new VelocityGenerator(false);
 
             generator.setCommonAttributes();
             generator.setAttributes("parseMethod", getAdapterMethod(dateType, ".parseDateTime"));

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java?rev=610130&r1=610129&r2=610130&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java Tue Jan  8 12:23:46 2008
@@ -41,7 +41,7 @@
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractGenerator.class);
     protected ToolContext env;
     protected String name;
-    protected final VelocityGenerator velocity = new VelocityGenerator();
+    protected VelocityGenerator velocity = new VelocityGenerator(false);
 
     public AbstractGenerator() {
     }