mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-25 14:34:47 +00:00
Ignore FileAlreadyExistsException in MoreFiles#createDirectories (#2525)
This commit is contained in:
1 file changed
+13
-2
@@ -27,6 +27,7 @@ package me.lucko.luckperms.common.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.FileAlreadyExistsException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
@@ -45,7 +46,12 @@ public final class MoreFiles {
|
||||
return path;
|
||||
}
|
||||
|
||||
Files.createDirectory(path);
|
||||
try {
|
||||
Files.createDirectory(path);
|
||||
} catch (FileAlreadyExistsException e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -54,7 +60,12 @@ public final class MoreFiles {
|
||||
return path;
|
||||
}
|
||||
|
||||
Files.createDirectories(path);
|
||||
try {
|
||||
Files.createDirectories(path);
|
||||
} catch (FileAlreadyExistsException e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user