use of com.airhacks.enhydrator.out.CSVFileSink in project enhydrator by AdamBien.
the class FromJsonToCSVTest method fromJSONToCSV.
@Test
public void fromJSONToCSV() throws FileNotFoundException {
Source source = new ScriptableSource(INPUT + "languages.json", INPUT + "converter.js", "UTF-8");
final CSVFileSink csvFileSink = new CSVFileSink("*", getFileName(), ";", true, false);
Pump pump = new Pump.Engine().from(source).to(new LogSink()).to(csvFileSink).build();
pump.start();
}
use of com.airhacks.enhydrator.out.CSVFileSink in project enhydrator by AdamBien.
the class CsvCharsetTest method fromJSONToCSVWithCharset.
@Test
public void fromJSONToCSVWithCharset() throws FileNotFoundException {
CSVFileSource source = new CSVFileSource(INPUT + "utf8-characters.csv", sourceDelimiter, sourceCharsetName, sourceContainsHeaders);
String fileName = getFileName();
final CSVFileSink csvFileSink = new CSVFileSink(sinkName, fileName, sinkDelimiter, sinkUseNamesAsHeaders, sinkAppend, "UTF-8");
// do the test
Pump pumpOut = new Pump.Engine().from(source).to(new LogSink()).to(csvFileSink).build();
pumpOut.start();
}
Aggregations