List of usage examples for org.jdom2.output LineSeparator UNIX
LineSeparator UNIX
To view the source code for org.jdom2.output LineSeparator UNIX.
Click Source Link
From source file:io.wcm.maven.plugins.contentpackage.unpacker.ContentUnpacker.java
License:Apache License
private void writeXmlWithExcludes(InputStream inputStream, OutputStream outputStream) throws IOException, JDOMException { SAXBuilder saxBuilder = new SAXBuilder(); Document doc = saxBuilder.build(inputStream); applyXmlExcludes(doc.getRootElement(), ""); XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat().setLineSeparator(LineSeparator.UNIX)); outputter.setXMLOutputProcessor(new OneAttributePerLineXmlProcessor()); outputter.output(doc, outputStream); outputStream.flush();/* w w w .j a v a 2 s .c o m*/ }
From source file:jodtemplate.util.JDOMHelper.java
License:Apache License
public String getRawContents(final Document dom) throws IOException { final Format format = Format.getRawFormat(); format.setLineSeparator(LineSeparator.UNIX); final XMLOutputter outputter = new XMLOutputter(format, new StandaloneOutputProcessor()); final Writer writer = new StringWriter(); outputter.output(dom, writer);//ww w . jav a 2 s . co m return writer.toString(); }
From source file:jodtemplate.util.JDOMHelper.java
License:Apache License
public void write(final Document dom, final OutputStream stream) throws IOException { final Format format = Format.getRawFormat(); format.setLineSeparator(LineSeparator.UNIX); final XMLOutputter outputter = new XMLOutputter(format, new StandaloneOutputProcessor()); outputter.output(dom, stream);// w w w . j a va 2s. c o m }
From source file:org.polago.deployconf.DeploymentWriter.java
License:Open Source License
/** * Write the given DeploymentConfig to persistent storage. * * @param deploymentConfig the DeploymentConfig to persist * @throws IOException indicating IO problems *//*from w w w.j av a 2s. co m*/ public void persist(DeploymentConfig deploymentConfig) throws IOException { Format format = Format.getPrettyFormat(); format.setLineSeparator(LineSeparator.UNIX); format.setExpandEmptyElements(true); XMLOutputter outputter = new XMLOutputter(format); Element root = new Element(DOM_ROOT); String name = deploymentConfig.getName(); if (name != null) { root.setAttribute(ATTR_NAME, name); } Document document = new Document(); document.setRootElement(root); for (Task task : deploymentConfig.getTasks()) { Element node = new Element(task.getSerializedName()); root.addContent(node); task.serialize(node, groupManager); } outputter.output(document, outputStream); }