Fix Tools.write

This commit is contained in:
artdeell 2023-03-03 16:40:07 +03:00
parent 00f6d29fb9
commit 57461d30e6

View File

@ -782,7 +782,10 @@ public final class Tools {
}
public static void write(String path, String content) throws IOException {
try(FileOutputStream outStream = new FileOutputStream(path)) {
File file = new File(path);
File parent = file.getParentFile();
if(!parent.exists()) parent.mkdirs();
try(FileOutputStream outStream = new FileOutputStream(file)) {
IOUtils.write(content, outStream);
}
}