mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-15 03:51:20 +01:00
Interpret a file name without extension as a directory, if not existent.
This commit is contained in:
parent
5f9764dabc
commit
a41b7a6329
@ -70,9 +70,13 @@ public class FileLogger {
|
||||
logger = Logger.getAnonymousLogger();
|
||||
detachLogger();
|
||||
final File container;
|
||||
if (!file.exists() && file.getName().indexOf('.') == -1) {
|
||||
// Make it a directory, if no extension is given.
|
||||
file.mkdirs();
|
||||
}
|
||||
if (file.isDirectory()) {
|
||||
container = file;
|
||||
// Find a file name.
|
||||
// File-name by date within the given folder.
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yy-MM-dd");
|
||||
String prefix = dateFormat.format(System.currentTimeMillis());
|
||||
int n = 1;
|
||||
@ -84,6 +88,7 @@ public class FileLogger {
|
||||
n ++;
|
||||
}
|
||||
} else {
|
||||
// Directly use the given file.
|
||||
container = file.getParentFile();
|
||||
}
|
||||
// Ensure the container exists.
|
||||
|
Loading…
Reference in New Issue
Block a user