Author: sergeyb
Date: Mon Jan 28 14:11:54 2013
New Revision: 1439413
URL: http://svn.apache.org/viewvc?rev=1439413&view=rev
Log:
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.7.x-fixes/ (props changed)
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Merged /cxf/trunk:r1439412
Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.7.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.7.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java?rev=1439413&r1=1439412&r2=1439413&view=diff
==============================================================================
---
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
(original)
+++
cxf/branches/2.7.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Mon Jan 28 14:11:54 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) {