try {
progress.setProgress(2);
progress.setNote("Saving to " + file.getName());
Hermes.ui.getDefaultMessageSink().add("Saving to " + file.getName());
ostream = new FileOutputStream(file);
hermes.toXML(messages, ostream);
ostream.close();
Hermes.ui.getDefaultMessageSink().add(
messages.size() + " message" + TextUtils.plural(messages.size()) + " saved to " + file.getName());
} catch (Exception ex) {