Skip to content

Commit

Permalink
MID-4924 (Post-initial import) adding of creating dir if not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Oct 11, 2018
1 parent 91895c3 commit aff61a7
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -201,9 +201,15 @@ private File[] getPostInitialImportObjects() {
File folder = new File(postInitialObjectsPath);
files = listFiles(folder);
sortFiles(files);
}
else {
LOGGER.debug("Directory " + postInitialObjectsPath + " does not exist.");
} else {
LOGGER.info("Directory " + postInitialObjectsPath + " does not exist. Creating.");
File dir = new File(postInitialObjectsPath);
if (!dir.exists() || !dir.isDirectory()) {
boolean created = dir.mkdirs();
if (!created) {
LOGGER.error("Unable to create directory " + postInitialObjectsPath + " as user " + System.getProperty("user.name"));
}
}
}
}
else {
Expand Down

0 comments on commit aff61a7

Please sign in to comment.