cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1439412 - /cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Date Mon, 28 Jan 2013 14:08:34 GMT
Author: sergeyb
Date: Mon Jan 28 14:08:34 2013
New Revision: 1439412

URL: http://svn.apache.org/viewvc?rev=1439412&view=rev
Log:
[CXF-4787] Updating wadl generator to use UTF-8 when creating files

Modified:
    cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java

Modified: cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java?rev=1439412&r1=1439411&r2=1439412&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
(original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Mon Jan 28 14:08:34 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;
@@ -1277,13 +1279,14 @@ public class SourceGenerator {
         
         try {
             file.createNewFile();
-            FileOutputStream fos = null;
+            Writer writer = null;
             try {
-                fos = new FileOutputStream(file);
-                fos.write(content.getBytes());
+                writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
+                writer.write(content);
+                writer.flush();
             } finally {
-                if (fos != null) {
-                    fos.close();
+                if (writer != null) {
+                    writer.close();
                 }
             }
         } catch (FileNotFoundException ex) {



Mime
View raw message