Create directory if folder has been deleted during runtime
This commit is contained in:
parent
9c2a0545d6
commit
4ca8651ebd
1 changed files with 4 additions and 0 deletions
|
|
@ -62,6 +62,10 @@ public class VelocityPluginCommandManager {
|
|||
* Saves the map to the {@link Path} it was loaded from.
|
||||
*/
|
||||
public void save() throws IOException {
|
||||
if (Files.notExists(path.getParent())) {
|
||||
Files.createDirectories(path.getParent());
|
||||
}
|
||||
|
||||
Files.write(
|
||||
path,
|
||||
gson.toJson(pluginCommands.asMap()).getBytes(StandardCharsets.UTF_8),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue