/** * @param root * @param file */ public static void write( Element root, File file ) throws IOException { System.out.print( "\nWriting DOM to " + file.getAbsolutePath() + " ... " ); System.out.flush(); // prepare a file writer. Writer writer = new BufferedWriter( new FileWriter( file ) ); // Write the content in the file (indented !!) DisplayXML.write( root, writer, " " ); writer.flush(); // Close the file writer.close(); System.out.println( "done." ); }
/** * @param root * @param file */ public static void write( Element root, File file ) throws IOException { System.out.print( "\nWriting DOM to " + file.getAbsolutePath() + " ... " ); System.out.flush(); // prepare a file writer. Writer writer = new BufferedWriter( new FileWriter( file ) ); // Write the content in the file (indented !!) DisplayXML.write( root, writer, " " ); writer.flush(); // Close the file writer.close(); System.out.println( "done." ); }
/** * @param root * @param file */ public static void write( Element root, File file ) throws IOException { System.out.print( "\nWriting DOM to " + file.getAbsolutePath() + " ... " ); System.out.flush(); // prepare a file writer. Writer writer = new BufferedWriter( new FileWriter( file ) ); // Write the content in the file (indented !!) DisplayXML.write( root, writer, " " ); writer.flush(); // Close the file writer.close(); System.out.println( "done." ); }
/** * Write an Element (supposingly the root of a document) into a file. * * @param root the root of the XML Document. * @param file the file in which we are supposed to write the content. * * @throws IOException if an error occur while writting. */ private static void write( Element root, File file ) throws IOException { System.out.print( "\nWriting DOM to " + file.getAbsolutePath() + " ... " ); System.out.flush(); // prepare a file writer. Writer writer = new BufferedWriter( new FileWriter( file ) ); // Write the content in the file (indented !!) DisplayXML.write( root, writer, " " ); writer.flush(); // Close the file writer.close(); System.out.println( "done." ); }
/** * Write an Element (supposingly the root of a document) into a file. * * @param root the root of the XML Document. * @param file the file in which we are supposed to write the content. * * @throws IOException if an error occur while writting. */ private static void write( Element root, File file ) throws IOException { System.out.print( "\nWriting DOM to " + file.getAbsolutePath() + " ... " ); System.out.flush(); // prepare a file writer. Writer writer = new BufferedWriter( new FileWriter( file ) ); // Write the content in the file (indented !!) DisplayXML.write( root, writer, " " ); writer.flush(); // Close the file writer.close(); System.out.println( "done." ); }
/** * Write an Element (supposingly the root of a document) into a file. * * @param root the root of the XML Document. * @param file the file in which we are supposed to write the content. * * @throws IOException if an error occur while writting. */ private static void write( Element root, File file ) throws IOException { System.out.print( "\nWriting DOM to " + file.getAbsolutePath() + " ... " ); System.out.flush(); // prepare a file writer. Writer writer = new BufferedWriter( new FileWriter( file ) ); // Write the content in the file (indented !!) DisplayXML.write( root, writer, " " ); writer.flush(); // Close the file writer.close(); System.out.println( "done." ); }
private static PsiValidatorReport writeFile(Document doc, File xmlFile, boolean validate) throws IOException { // create the parent dir if it does not exist if (!xmlFile.getParentFile().exists()) { log.info("Creating dir: "+xmlFile.getParentFile()); xmlFile.getParentFile().mkdirs(); } Writer writer = new FileWriter(xmlFile); DisplayXML.write(doc, writer, " "); writer.close(); if (validate) { return PsiValidator.validate(xmlFile); } return new PsiValidatorReport(); }
private static PsiValidatorReport writeFile(Document doc, File xmlFile, boolean validate) throws IOException { // create the parent dir if it does not exist if (!xmlFile.getParentFile().exists()) { log.info("Creating dir: "+xmlFile.getParentFile()); xmlFile.getParentFile().mkdirs(); } Writer writer = new FileWriter(xmlFile); DisplayXML.write(doc, writer, " "); writer.close(); if (validate) { return PsiValidator.validate(xmlFile); } return new PsiValidatorReport(); }
private static PsiValidatorReport writeFile(Document doc, File xmlFile, boolean validate) throws IOException { // create the parent dir if it does not exist if (!xmlFile.getParentFile().exists()) { log.info("Creating dir: "+xmlFile.getParentFile()); xmlFile.getParentFile().mkdirs(); } Writer writer = new FileWriter(xmlFile); DisplayXML.write(doc, writer, " "); writer.close(); if (validate) { return PsiValidator.validate(xmlFile); } return new PsiValidatorReport(); }