mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-28 18:31:24 +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();
|
logger = Logger.getAnonymousLogger();
|
||||||
detachLogger();
|
detachLogger();
|
||||||
final File container;
|
final File container;
|
||||||
|
if (!file.exists() && file.getName().indexOf('.') == -1) {
|
||||||
|
// Make it a directory, if no extension is given.
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
container = file;
|
container = file;
|
||||||
// Find a file name.
|
// File-name by date within the given folder.
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yy-MM-dd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yy-MM-dd");
|
||||||
String prefix = dateFormat.format(System.currentTimeMillis());
|
String prefix = dateFormat.format(System.currentTimeMillis());
|
||||||
int n = 1;
|
int n = 1;
|
||||||
@ -84,6 +88,7 @@ public class FileLogger {
|
|||||||
n ++;
|
n ++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// Directly use the given file.
|
||||||
container = file.getParentFile();
|
container = file.getParentFile();
|
||||||
}
|
}
|
||||||
// Ensure the container exists.
|
// Ensure the container exists.
|
||||||
|
Loading…
Reference in New Issue
Block a user