cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1439444 - in /cxf/branches/2.6.x-fixes: ./ tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Date Mon, 28 Jan 2013 15:12:27 GMT
Author: sergeyb
Date: Mon Jan 28 15:12:27 2013
New Revision: 1439444

URL: http://svn.apache.org/viewvc?rev=1439444&view=rev
Log:
Merged revisions 1439413 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1439413 | sergeyb | 2013-01-28 14:11:54 +0000 (Mon, 28 Jan 2013) | 9 lines
  
  Merged revisions 1439412 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1439412 | sergeyb | 2013-01-28 14:08:34 +0000 (Mon, 28 Jan 2013) | 1 line
    
    [CXF-4787] Updating wadl generator to use UTF-8 when creating files
  ........
................

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1439413
  Merged /cxf/trunk:r1439412

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

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java?rev=1439444&r1=1439443&r2=1439444&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Mon Jan 28 15:12:27 2013
@@ -24,8 +24,10 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.StringReader;
+import java.io.Writer;
 import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
@@ -1255,9 +1257,16 @@ public class SourceGenerator {
         
         try {
             file.createNewFile();
-            FileOutputStream fos = new FileOutputStream(file);
-            fos.write(content.getBytes());
-            fos.close();
+            Writer writer = null;
+            try {
+                writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
+                writer.write(content);
+                writer.flush();
+            } finally {
+                if (writer != null) {
+                    writer.close();
+                }
+            }
         } catch (FileNotFoundException ex) {
             LOG.warning(file.getAbsolutePath() + " is not found");
         } catch (IOException ex) {



Mime
View raw message