Skip to content

Commit

Permalink
Switch to Files.createDirectories()
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Sep 17, 2023
1 parent 0d04d38 commit 4f3a209
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,12 @@ public boolean isDirect() {
*/
public boolean mkdirs() {
if (docTree == null) {
// TODO: Use Files.createDirectories() when AGP 8.1 is available:
// https://issuetracker.google.com/issues/282544786
return Files.exists(ioTree) || ioTree.toFile().mkdirs();
try {
Files.createDirectories(ioTree);
} catch (final IOException e) {
Log.e(TAG, "Error while creating directories at " + ioTree, e);
}
return Files.exists(ioTree);
}

if (docTree.exists()) {
Expand Down

0 comments on commit 4f3a209

Please sign in to comment.