Search in sources :

Example 1 with XMLDecl

use of electric.xml.XMLDecl in project blue by kunstmusik.

the class CodeRepositoryManager method saveCodeRepository.

public static void saveCodeRepository(DefaultMutableTreeNode node) {
    Element root = getElement(node);
    Document doc = new Document();
    doc.addChild(new XMLDecl("1.0", "UTF-8"));
    doc.setRoot(root);
    try {
        try (FileOutputStream out = new FileOutputStream(BlueSystem.getCodeRepository())) {
            doc.write(out);
            out.flush();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    CodeRepositoryMenu.reinitialize();
}
Also used : Element(electric.xml.Element) FileOutputStream(java.io.FileOutputStream) XMLDecl(electric.xml.XMLDecl) Document(electric.xml.Document) ParseException(electric.xml.ParseException)

Aggregations

Document (electric.xml.Document)1 Element (electric.xml.Element)1 ParseException (electric.xml.ParseException)1 XMLDecl (electric.xml.XMLDecl)1 FileOutputStream (java.io.FileOutputStream)1