public static void writeDocument(final KAFDocument document, @Nullable final Path location) throws IOException { if (location == null) { System.out.write(document.toString().getBytes(Charsets.UTF_8)); } else { try (Writer writer = IO.utf8Writer(IO.buffer(IO.write(location.toString())))) { writer.write(document.toString()); } } }
@SuppressWarnings("unchecked") @Override public void handle(final BindingSet bindings) throws Throwable { if (this.writer == null) { this.writer = IO.utf8Writer(IO.buffer(IO.write(Query.this.file .getAbsolutePath()))); writerToClose.set(this.writer); this.variables = stream.getProperty("variables", List.class); for (int i = 0; i < this.variables.size(); ++i) { this.writer.write(i > 0 ? "\t?" : "?"); this.writer.write(this.variables.get(i)); } this.writer.write("\n"); } if (bindings != null) { this.writer.write(TestUtil.encode(this.variables, bindings)); this.writer.write("\n"); tracker.increment(); } }
logger.info("Writing file " + outputFile); Files.createParentDirs(outputFile); try (Writer w = IO.utf8Writer(IO.buffer(IO.write(outputFile.getAbsolutePath())))) { w.write(naf);
public void writeTo(final String location) throws IOException { try (Writer writer = IO.utf8Writer(IO.buffer(IO.write(location)))) { writeTo(writer); } }
public void run() throws Throwable { final Writer writer = this.outputFile == null ? null : IO.utf8Writer(IO.buffer(IO .write(this.outputFile.getAbsolutePath())));
try (Writer writer = IO.utf8Writer(IO.buffer(IO.write(file.getAbsolutePath())))) {
logger.info("Writing empty file " + outputFile); Files.createParentDirs(outputFile); try (Writer w = IO.utf8Writer(IO.buffer(IO.write(outputFile.getAbsolutePath())))) { w.write(document.toString());
final Model model = this.generator.generate(document, null); Files.createParentDirs(outputFile); try (Writer writer = IO.utf8Writer(IO.write(outputFile.getAbsolutePath()))) { renderer.renderAll(writer, document, model, this.template, null);
try (Writer writer = IO.utf8Writer(IO.buffer(IO.write(output.getAbsolutePath())))) { for (int childNum = 0; childNum < sortedIDs.size(); ++childNum) { final String childID = sortedIDs.get(childNum);