Switch to Files.createDirectories()

This commit is contained in:
Isira Seneviratne 2023-09-18 05:14:15 +05:30 committed by TobiGr
parent fcb855cea9
commit a1f2b7f8e8
1 changed files with 6 additions and 3 deletions

View File

@ -180,9 +180,12 @@ public class StoredDirectoryHelper {
*/
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()) {