Author: sergeyb Date: Mon Jan 28 15:25:25 2013 New Revision: 1439448 URL: http://svn.apache.org/viewvc?rev=1439448&view=rev Log: Merged revisions 1439444 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes
................ r1439444 | sergeyb | 2013-01-28 15:12:27 +0000 (Mon, 28 Jan 2013) | 16 lines 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.5.x-fixes/ (props changed) cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java Propchange: cxf/branches/2.5.x-fixes/ ------------------------------------------------------------------------------ Merged /cxf/branches/2.7.x-fixes:r1439413 Merged /cxf/trunk:r1439412 Merged /cxf/branches/2.6.x-fixes:r1439444 Propchange: cxf/branches/2.5.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java?rev=1439448&r1=1439447&r2=1439448&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java (original) +++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java Mon Jan 28 15:25:25 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; @@ -1251,9 +1253,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) {
