Exemple #1
0
 @Override
 public void format(OutputStream out, boolean answer) {
   PrintWriter pw = FileUtils.asPrintWriterUTF8(out);
   if (answer) pw.write("yes");
   else pw.write("no");
   pw.flush();
 }
Exemple #2
0
 public void testWithContent() throws IOException {
   File f = FileUtils.tempFileName("assembler-acceptance-", ".n3");
   Model data = model("a P b; b Q c");
   try (FileOutputStream fs = new FileOutputStream(f)) {
     data.write(fs, "N3");
   }
   Resource root =
       resourceInModel(
           "x rdf:type ja:MemoryModel; x ja:content y; y ja:externalContent file:"
               + f.getAbsolutePath());
   Model m = Assembler.general.openModel(root);
   assertIsoModels(data, m);
 }
Exemple #3
0
 /**
  * Output a result set.
  *
  * @param outs OutputStream
  * @param resultSet ResultSet
  * @param colStart Left column
  * @param colSep Inter-column
  * @param colEnd Right column
  */
 public void write(
     OutputStream outs, ResultSet resultSet, String colStart, String colSep, String colEnd) {
   PrintWriter pw = FileUtils.asPrintWriterUTF8(outs);
   write(pw, resultSet, colStart, colSep, colEnd);
   pw.flush();
 }