FileOutputStream out = null;
try {
if (!propsFile.exists()) {
boolean created = propsFile.createNewFile();
if (!created) {
throw new SimalRepositoryException(
"Unable to create properties file: " + propsFile.toString());
}
}
out = new FileOutputStream(propsFile);
localProps.store(out, comments);
} catch (IOException e) {
throw new SimalRepositoryException("Failed to save properties file to "
+ propsFile, e);
} finally {
try {
if (out != null) {
out.close();
}
} catch (IOException e) {
throw new SimalRepositoryException("Unable to close properties file: "
+ propsFile, e);
}
}
}