if (fileLimit < 1) {
File file = new File(outputFile);
if (file.getParentFile() != null) {
file.getParentFile().mkdirs();
}
writer = new StackTraceWriter(new FileOutputStream(file));
System.out.println("Writing to " + file.getAbsolutePath());
}
else {
int c = outputFile.lastIndexOf('.');
String pref = c < 0 ? outputFile : outputFile.substring(0, c);
String suf = c < 0 ? "" : outputFile.substring(c);
String name = pref + String.format("-%02d", rotSeg) + suf;
File file = new File(name);
if (file.getParentFile() != null) {
file.getParentFile().mkdirs();
}
writer = new StackTraceWriter(new FileOutputStream(file));
System.out.println("Writing to " + file.getAbsolutePath());
}
}