StatsWriterStreamer sws = StatsWriterFactory.createStreamer(ci.getCore());
String file = null;
if ((args != null) && (!args.isEmpty()))
file = (String) args.get(0);
if (file == null) {
try {
ci.out.println("> -----");
sws.write(ci.out);
ci.out.println("> -----");
} catch (Exception e) {
ci.out.println("> Exception while trying to output xml stats:" + e.getMessage());
}
} else {
try {
FileOutputStream os = new FileOutputStream(file);
try {
sws.write(os);
} finally {
os.close();
}
ci.out.println("> XML stats successfully written to " + file);
} catch (Exception e) {
ci.out.println("> Exception while trying to write xml stats:" + e.getMessage());
}
}