use of de.pdark.decentxml.XMLWriter in project tycho by eclipse.
the class PomFile method write.
public static void write(PomFile pom, OutputStream out) throws IOException {
String encoding = pom.document.getEncoding() != null ? pom.document.getEncoding() : DEFAULT_XML_ENCODING;
Writer w = new OutputStreamWriter(out, encoding);
XMLWriter xw = new XMLWriter(w);
try {
pom.setVersionInXML();
pom.document.toXML(xw);
} finally {
xw.flush();
}
}
use of de.pdark.decentxml.XMLWriter in project tycho by eclipse.
the class TargetDefinitionFile method write.
public static void write(TargetDefinitionFile target, File file) throws IOException {
OutputStream os = new BufferedOutputStream(new FileOutputStream(file));
Document document = target.document;
try {
String enc = document.getEncoding() != null ? document.getEncoding() : "UTF-8";
Writer w = new OutputStreamWriter(os, enc);
XMLWriter xw = new XMLWriter(w);
try {
document.toXML(xw);
} finally {
xw.flush();
}
} finally {
IOUtil.close(os);
}
}
use of de.pdark.decentxml.XMLWriter in project fabric8 by jboss-fuse.
the class RouteXml method writeXml.
public void writeXml(Document doc, File file) throws IOException {
File parentDir = file.getParentFile();
if (parentDir != null) {
parentDir.mkdirs();
}
XMLWriter writer = new XMLWriter(new FileWriter(file));
doc.toXML(writer);
writer.close();
}
use of de.pdark.decentxml.XMLWriter in project tycho by eclipse.
the class Category method write.
public static void write(Category category, File file) throws IOException {
OutputStream os = new BufferedOutputStream(new FileOutputStream(file));
Document document = category.document;
try {
String enc = document.getEncoding() != null ? document.getEncoding() : "UTF-8";
Writer w = new OutputStreamWriter(os, enc);
XMLWriter xw = new XMLWriter(w);
try {
document.toXML(xw);
} finally {
xw.flush();
}
} finally {
IOUtil.close(os);
}
}
Aggregations