Skip to content

Commit

Permalink
ugly fix improvement for MID-1631
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed May 21, 2014
1 parent 8208334 commit 026c90d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Expand Up @@ -534,12 +534,17 @@ private Writer createWriter(String fileName) throws IOException {

MidpointConfiguration config = getMidpointConfiguration();
File exportFolder = new File(config.getMidpointHome() + "/export/");
if (!exportFolder.exists() || !exportFolder.isDirectory()) {
exportFolder.mkdir();
}

File file = new File(exportFolder, fileName);
file.createNewFile();
try {
if (!exportFolder.exists() || !exportFolder.isDirectory()) {
exportFolder.mkdir();
}

file.createNewFile();
} catch (Exception ex) {
error(getString("PageAccounts.exportFileDoesntExist", file.getAbsolutePath()));
throw ex;
}

return new OutputStreamWriter(new FileOutputStream(file), "utf-8");
}
Expand Down
Expand Up @@ -36,4 +36,5 @@ PageAccounts.accounts.synchronizationSituation=Situation
PageAccounts.accounts.synchronizationTimestamp=Timestamp
PageAccounts.accounts.description=Description
PageAccounts.exportException=Error occurred during export, reason {0}
PageAccounts.button.clearExportFolder=Clear export folder
PageAccounts.button.clearExportFolder=Clear export folder
PageAccounts.exportFileDoesntExist=Couldn't create file {0}

0 comments on commit 026c90d

Please sign in to comment.