Switch to Files.createDirectories()
This commit is contained in:
parent
fcb855cea9
commit
a1f2b7f8e8
1 changed files with 6 additions and 3 deletions
|
@ -180,9 +180,12 @@ public class StoredDirectoryHelper {
|
||||||
*/
|
*/
|
||||||
public boolean mkdirs() {
|
public boolean mkdirs() {
|
||||||
if (docTree == null) {
|
if (docTree == null) {
|
||||||
// TODO: Use Files.createDirectories() when AGP 8.1 is available:
|
try {
|
||||||
// https://issuetracker.google.com/issues/282544786
|
Files.createDirectories(ioTree);
|
||||||
return Files.exists(ioTree) || ioTree.toFile().mkdirs();
|
} catch (final IOException e) {
|
||||||
|
Log.e(TAG, "Error while creating directories at " + ioTree, e);
|
||||||
|
}
|
||||||
|
return Files.exists(ioTree);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (docTree.exists()) {
|
if (docTree.exists()) {
|
||||||
|
|
Loading…
Reference in a new issue