Commit 032d11cd authored by Matt Tucker's avatar Matt Tucker Committed by matt

Attempted fix of regression introduced by JM-518 (without breaking the JM-518 "fix").

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3632 b35dd754-fafc-0310-a699-88a17e54d16e
parent 7283255b
......@@ -453,7 +453,9 @@ public class XMLProperties {
try {
tempFile = new File(file.getParentFile(), file.getName() + ".tmp");
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile)));
writer.write(document.asXML());
OutputFormat prettyPrinter = OutputFormat.createPrettyPrint();
XMLWriter xmlWriter = new XMLWriter(writer, prettyPrinter);
xmlWriter.write(document);
}
catch (Exception e) {
Log.error(e);
......@@ -554,12 +556,12 @@ public class XMLProperties {
/**
* Copies data from an input stream to an output stream
*
* @param in The stream to copy data from
* @param out The stream to copy data to
* @throws IOException if there's trouble during the copy
* @param in the stream to copy data from.
* @param out the stream to copy data to.
* @throws IOException if there's trouble during the copy.
*/
private static void copy(InputStream in, OutputStream out) throws IOException {
// do not allow other threads to whack on in or out during copy
// Do not allow other threads to intrude on streams during copy.
synchronized (in) {
synchronized (out) {
byte[] buffer = new byte[256];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment