diff --git a/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/XmlWriter.java b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/XmlWriter.java index 1c4b735451..e9bdeb3999 100644 --- a/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/XmlWriter.java +++ b/tez-tools/tez-javadoc-tools/src/main/java/org/apache/tez/tools/javadoc/util/XmlWriter.java @@ -21,14 +21,17 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang.StringUtils; import org.apache.tez.tools.javadoc.model.Config; import org.apache.tez.tools.javadoc.model.ConfigProperty; +import com.google.common.io.ByteStreams; + public class XmlWriter extends Writer { public void write(Config config) throws IOException { @@ -46,9 +49,10 @@ public void write(Config config) throws IOException { try { File file = new File(fileName); - out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8")); + writeApacheHeader(file); + + out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file, true), "UTF-8")); - out.println(""); out.println(""); out.println(); out.println("