added indent spaces to security.xml

This commit is contained in:
Sebastian Sdorra
2013-05-20 17:34:16 +02:00
parent aa1412f8d7
commit c6a0dd6b01
2 changed files with 18 additions and 9 deletions

View File

@@ -41,6 +41,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.security.KeyGenerator;
import sonia.scm.xml.IndentXMLStreamWriter;
//~--- JDK imports ------------------------------------------------------------
@@ -348,18 +349,22 @@ public class JAXBConfigurationEntryStore<V>
{
logger.debug("store configuration to {}", file);
XMLStreamWriter writer = null;
IndentXMLStreamWriter writer = null;
try
{
writer = XMLOutputFactory.newFactory().createXMLStreamWriter(
new FileOutputStream(file));
//J-
writer = new IndentXMLStreamWriter(
XMLOutputFactory.newFactory().createXMLStreamWriter(
new FileOutputStream(file)
)
);
//J+
writer.writeStartDocument();
writer.writeStartElement(TAG_CONFIGURATION);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
for (Entry<String, V> e : entries.entrySet())