|
@@ -211,11 +211,9 @@ public class XMLResultAggregator extends Task implements XMLConstants { |
|
|
* @throws IOException thrown if there is an error while writing the content. |
|
|
* @throws IOException thrown if there is an error while writing the content. |
|
|
*/ |
|
|
*/ |
|
|
protected void writeDOMTree(Document doc, File file) throws IOException { |
|
|
protected void writeDOMTree(Document doc, File file) throws IOException { |
|
|
OutputStream out = null; |
|
|
|
|
|
PrintWriter wri = null; |
|
|
|
|
|
|
|
|
OutputStream os = new FileOutputStream(file); |
|
|
try { |
|
|
try { |
|
|
out = new BufferedOutputStream(new FileOutputStream(file)); |
|
|
|
|
|
wri = new PrintWriter(new OutputStreamWriter(out, "UTF8")); |
|
|
|
|
|
|
|
|
PrintWriter wri = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(os), "UTF8")); |
|
|
wri.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); |
|
|
wri.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); |
|
|
(new DOMElementWriter()).write(doc.getDocumentElement(), wri, 0, " "); |
|
|
(new DOMElementWriter()).write(doc.getDocumentElement(), wri, 0, " "); |
|
|
wri.flush(); |
|
|
wri.flush(); |
|
@@ -224,8 +222,7 @@ public class XMLResultAggregator extends Task implements XMLConstants { |
|
|
throw new IOException("Error while writing DOM content"); |
|
|
throw new IOException("Error while writing DOM content"); |
|
|
} |
|
|
} |
|
|
} finally { |
|
|
} finally { |
|
|
FileUtils.close(wri); |
|
|
|
|
|
FileUtils.close(out); |
|
|
|
|
|
|
|
|
os.close(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|