Search in sources :

Example 1 with LogWriter

use of com.evolveum.midpoint.cli.ninja.util.LogWriter in project midpoint by Evolveum.

the class ExportAction method createWriter.

private Writer createWriter() throws IOException {
    File file = getParams().getFile();
    if (file != null) {
        if (file.exists()) {
            file.delete();
        }
        file.createNewFile();
        OutputStream os = new FileOutputStream(file);
        if (getParams().isZip()) {
            os = new ZipOutputStream(os);
        }
        Writer writer = new OutputStreamWriter(os, StandardCharsets.UTF_8);
        return new BufferedWriter(writer);
    }
    return new LogWriter(STD_OUT);
}
Also used : LogWriter(com.evolveum.midpoint.cli.ninja.util.LogWriter) ZipOutputStream(java.util.zip.ZipOutputStream) ZipOutputStream(java.util.zip.ZipOutputStream) LogWriter(com.evolveum.midpoint.cli.ninja.util.LogWriter)

Aggregations

LogWriter (com.evolveum.midpoint.cli.ninja.util.LogWriter)1 ZipOutputStream (java.util.zip.ZipOutputStream)1