maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r629658 - /maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
Date Thu, 21 Feb 2008 00:00:35 GMT
Author: vsiveton
Date: Wed Feb 20 16:00:28 2008
New Revision: 629658

URL: http://svn.apache.org/viewvc?rev=629658&view=rev
Log:
MPLUGIN-76: Fixed file encoding employed by PluginXDocGenerator
Submitted by: Benjamin Bentmann
Reviewed by: Vincent Siveton

o applied

Modified:
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java

Modified: maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java?rev=629658&r1=629657&r2=629658&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
Wed Feb 20 16:00:28 2008
@@ -20,8 +20,10 @@
  */
 
 import java.io.File;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -87,10 +89,11 @@
     protected void processMojoDescriptor( MojoDescriptor mojoDescriptor, File destinationDirectory
)
         throws IOException
     {
-        FileWriter writer = null;
+        File outputFile = new File( destinationDirectory, getMojoFilename( mojoDescriptor,
"xml" ) );
+        OutputStreamWriter writer = null;
         try
         {
-            writer = new FileWriter( new File( destinationDirectory, getMojoFilename( mojoDescriptor,
"xml" ) ) );
+            writer = new OutputStreamWriter( new FileOutputStream( outputFile ), "UTF-8"
);
 
             writeBody( writer, mojoDescriptor );
 
@@ -107,9 +110,9 @@
         return mojo.getGoal() + "-mojo." + ext;
     }
 
-    private void writeBody( FileWriter writer, MojoDescriptor mojoDescriptor )
+    private void writeBody( OutputStreamWriter writer, MojoDescriptor mojoDescriptor )
     {
-        XMLWriter w = new PrettyPrintXMLWriter( writer );
+        XMLWriter w = new PrettyPrintXMLWriter( new PrintWriter( writer ), writer.getEncoding(),
null );
 
         w.startElement( "document" );
 



Mime
View raw message