@Test public void arrayWithQuotesRoundTrip() throws Exception { ValueArray input = ValueFactory.createArray(3); input.add(ValueFactory.create("foo")); input.add(ValueFactory.create("bar\"bar")); input.add(ValueFactory.create("baz")); csvEncodedJSONRoundTrip(input); }
public static DelimitedEscapedBundleEncoder create(String filename, String format) { String delimiter; switch (format) { case "csv2": delimiter = ","; break; case "psv2": delimiter = "|"; break; case "tsv2": delimiter = "\t"; break; default: throw new QueryException("Invalid format \"" + format + "\""); } String suffix = format.substring(0, 3); if (!filename.toLowerCase().endsWith("." + suffix)) { filename = filename.concat("." + suffix); } return new DelimitedEscapedBundleEncoder(filename, delimiter); }
DelimitedEscapedBundleEncoder extends AbstractBufferingHttpBundleEncoder { public static DelimitedEscapedBundleEncoder create(String filename, String format) { String delimiter; switch (format) { case "csv2": delimiter = ","; break; case "psv2": delimiter = "|"; break; case "tsv2": delimiter = "\t"; break; default: throw new QueryException("Invalid format \"" + format + "\""); } String suffix = format.substring(0, 3); if (!filename.toLowerCase().endsWith("." + suffix)) { filename = filename.concat("." + suffix); } return new DelimitedEscapedBundleEncoder(filename, delimiter); } }
DelimitedEscapedBundleEncoder extends AbstractBufferingHttpBundleEncoder { public static DelimitedEscapedBundleEncoder create(String filename, String format) { String delimiter; switch (format) { case "csv2": delimiter = ","; break; case "psv2": delimiter = "|"; break; case "tsv2": delimiter = "\t"; break; default: throw new QueryException("Invalid format \"" + format + "\""); } String suffix = format.substring(0, 3); if (!filename.toLowerCase().endsWith("." + suffix)) { filename = filename.concat("." + suffix); } return new DelimitedEscapedBundleEncoder(filename, delimiter); } DelimitedEscapedBundleEncoder(String filename, String delimiter); }
DelimitedEscapedBundleEncoder extends AbstractBufferingHttpBundleEncoder { public static DelimitedEscapedBundleEncoder create(String filename, String format) { String delimiter; switch (format) { case "csv2": delimiter = ","; break; case "psv2": delimiter = "|"; break; case "tsv2": delimiter = "\t"; break; default: throw new QueryException("Invalid format \"" + format + "\""); } String suffix = format.substring(0, 3); if (!filename.toLowerCase().endsWith("." + suffix)) { filename = filename.concat("." + suffix); } return new DelimitedEscapedBundleEncoder(filename, delimiter); } DelimitedEscapedBundleEncoder(String filename, String delimiter); static DelimitedEscapedBundleEncoder create(String filename, String format); static String buildRow(Bundle row, String delimiter); static void buildRow(Bundle row, String delimiter, StringBuilder stringBuilder); @Override void appendBundleToString(Bundle row, StringBuilder stringBuilder); }
DelimitedEscapedBundleEncoder extends AbstractBufferingHttpBundleEncoder { public static DelimitedEscapedBundleEncoder create(String filename, String format) { String delimiter; switch (format) { case "csv2": delimiter = ","; break; case "psv2": delimiter = "|"; break; case "tsv2": delimiter = "\t"; break; default: throw new QueryException("Invalid format \"" + format + "\""); } String suffix = format.substring(0, 3); if (!filename.toLowerCase().endsWith("." + suffix)) { filename = filename.concat("." + suffix); } return new DelimitedEscapedBundleEncoder(filename, delimiter); } DelimitedEscapedBundleEncoder(String filename, String delimiter); static DelimitedEscapedBundleEncoder create(String filename, String format); static String buildRow(Bundle row, String delimiter); static void buildRow(Bundle row, String delimiter, StringBuilder stringBuilder); @Override void appendBundleToString(Bundle row, StringBuilder stringBuilder);  }