Skip to content

Commit

Permalink
storage: support nested paths in file storage
Browse files Browse the repository at this point in the history
Reviewed-by: rwestberg
  • Loading branch information
edvbld committed Sep 1, 2020
1 parent 931a0b1 commit 59448e7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public void put(Collection<T> items) {
return;
}
try {
Files.createDirectories(file.getParent());
if (!Files.exists(file)) {
Files.createFile(file);
}
Files.writeString(file, updated, StandardCharsets.UTF_8);
} catch (IOException e) {
throw new UncheckedIOException(e);
Expand Down

1 comment on commit 59448e7

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 59448e7 Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.