mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
added indent spaces to security.xml
This commit is contained in:
@@ -227,7 +227,7 @@ public final class IndentXMLStreamWriter implements XMLStreamWriter
|
|||||||
public void writeEndDocument() throws XMLStreamException
|
public void writeEndDocument() throws XMLStreamException
|
||||||
{
|
{
|
||||||
writer.writeEndDocument();
|
writer.writeEndDocument();
|
||||||
writer.writeCharacters(LINE_SEPARATOR);
|
writeLineSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -286,7 +286,7 @@ public final class IndentXMLStreamWriter implements XMLStreamWriter
|
|||||||
public void writeStartDocument() throws XMLStreamException
|
public void writeStartDocument() throws XMLStreamException
|
||||||
{
|
{
|
||||||
writer.writeStartDocument();
|
writer.writeStartDocument();
|
||||||
writer.writeCharacters(LINE_SEPARATOR);
|
writeLineSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -296,7 +296,7 @@ public final class IndentXMLStreamWriter implements XMLStreamWriter
|
|||||||
public void writeStartDocument(String version) throws XMLStreamException
|
public void writeStartDocument(String version) throws XMLStreamException
|
||||||
{
|
{
|
||||||
writer.writeStartDocument(version);
|
writer.writeStartDocument(version);
|
||||||
writer.writeCharacters(LINE_SEPARATOR);
|
writeLineSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -307,7 +307,7 @@ public final class IndentXMLStreamWriter implements XMLStreamWriter
|
|||||||
throws XMLStreamException
|
throws XMLStreamException
|
||||||
{
|
{
|
||||||
writer.writeStartDocument(encoding, version);
|
writer.writeStartDocument(encoding, version);
|
||||||
writer.writeCharacters(LINE_SEPARATOR);
|
writeLineSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -402,6 +402,10 @@ public final class IndentXMLStreamWriter implements XMLStreamWriter
|
|||||||
writer.setPrefix(prefix, uri);
|
writer.setPrefix(prefix, uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void writeLineSeparator() throws XMLStreamException{
|
||||||
|
writer.writeCharacters(LINE_SEPARATOR);
|
||||||
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -434,7 +438,7 @@ public final class IndentXMLStreamWriter implements XMLStreamWriter
|
|||||||
|
|
||||||
if (level == 0)
|
if (level == 0)
|
||||||
{
|
{
|
||||||
writer.writeCharacters(LINE_SEPARATOR);
|
writeLineSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
lastWasStart = false;
|
lastWasStart = false;
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import sonia.scm.security.KeyGenerator;
|
import sonia.scm.security.KeyGenerator;
|
||||||
|
import sonia.scm.xml.IndentXMLStreamWriter;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
|
|
||||||
@@ -348,18 +349,22 @@ public class JAXBConfigurationEntryStore<V>
|
|||||||
{
|
{
|
||||||
logger.debug("store configuration to {}", file);
|
logger.debug("store configuration to {}", file);
|
||||||
|
|
||||||
XMLStreamWriter writer = null;
|
IndentXMLStreamWriter writer = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
writer = XMLOutputFactory.newFactory().createXMLStreamWriter(
|
//J-
|
||||||
new FileOutputStream(file));
|
writer = new IndentXMLStreamWriter(
|
||||||
|
XMLOutputFactory.newFactory().createXMLStreamWriter(
|
||||||
|
new FileOutputStream(file)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
//J+
|
||||||
writer.writeStartDocument();
|
writer.writeStartDocument();
|
||||||
writer.writeStartElement(TAG_CONFIGURATION);
|
writer.writeStartElement(TAG_CONFIGURATION);
|
||||||
|
|
||||||
Marshaller m = context.createMarshaller();
|
Marshaller m = context.createMarshaller();
|
||||||
|
|
||||||
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
|
|
||||||
m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
|
m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
|
||||||
|
|
||||||
for (Entry<String, V> e : entries.entrySet())
|
for (Entry<String, V> e : entries.entrySet())
|
||||||
|
|||||||
Reference in New Issue
Block a user