cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r609658 - in /incubator/cxf/trunk: 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/apache/cxf/tools/com...
Date Mon, 07 Jan 2008 16:07:31 GMT
Author: dkulp
Date: Mon Jan  7 08:07:30 2008
New Revision: 609658

URL: http://svn.apache.org/viewvc?rev=609658&view=rev
Log:
[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/trunk/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java
    incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java

Modified: incubator/cxf/trunk/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java?rev=609658&r1=609657&r2=609658&view=diff
==============================================================================
--- incubator/cxf/trunk/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java
(original)
+++ incubator/cxf/trunk/maven-plugins/eclipse-plugin-generator/src/main/java/org/apache/cxf/maven_plugin/eclipse/EclipsePluginMojo.java
Mon Jan  7 08:07:30 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/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=609658&r1=609657&r2=609658&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Mon Jan  7 08:07:30 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/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java?rev=609658&r1=609657&r2=609658&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/VelocityGenerator.java
Mon Jan  7 08:07:30 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/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java?rev=609658&r1=609657&r2=609658&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
Mon Jan  7 08:07:30 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/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java?rev=609658&r1=609657&r2=609658&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/DateTypeCustomGenerator.java
Mon Jan  7 08:07:30 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/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java?rev=609658&r1=609657&r2=609658&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/AbstractGenerator.java
Mon Jan  7 08:07:30 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() {
     }



Mime
View raw message