try {
Properties properties = cockpitPreferences.toProperties();
if (!cockpitHomeDirectory.exists()) {
cockpitHomeDirectory.mkdir();
}
properties.list(new PrintStream(
new FileOutputStream(cockpitPreferencesPropertiesFile)));
} catch (IOException e) {
String message = "Unable to save your preferences";
log.error(message, e);
ErrorDialog.showDialog(ownerFrame, this, message, e);