private static Dir createOutputDir() {
String applicationName = Settings.getApplicationName();
Format format = new SimpleDateFormat("yyyy-MM-dd_a-hh-mm-ss");
Dir parent = Settings.getBaseDirectory();
if (applicationName != null) {
parent = parent.createChildDir(applicationName);
}
parent.make();
Dir outputDir = null;
int maxAttempts = 100;
while ((outputDir == null) && (maxAttempts > 0)) {
try {
Dir dir = parent.createChildDir(format.format(new Date()));
dir.make();
outputDir = dir;
} catch (Exception e) {
pause();
}
maxAttempts--;