Skip to content

Commit

Permalink
Make directory creation more robust
Browse files Browse the repository at this point in the history
See gh-109
  • Loading branch information
wilkinsona committed Mar 14, 2024
1 parent 137903b commit 89e320b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ private String formatExternalLinks(ExternalLink externalLink) {
}

private void writeContentToFile(String content, String path) throws IOException {
File file = new File(path);
file.getParentFile().mkdirs();
File file = new File(path).getAbsoluteFile();
File parent = file.getParentFile();
if (parent != null) {
parent.mkdirs();
}
FileCopyUtils.copy(content, new FileWriter(file));
}

Expand Down

0 comments on commit 89e320b

Please sign in to comment.