Avoiding conflicted for creating directory.
This commit is contained in:
parent
e24a75c2bc
commit
4ed7aa350b
@ -150,9 +150,13 @@ public class DiskCache {
|
|||||||
|
|
||||||
private static File makeSureCacheDirExists(String dir) {
|
private static File makeSureCacheDirExists(String dir) {
|
||||||
File cacheDir = new File(dir);
|
File cacheDir = new File(dir);
|
||||||
if (!cacheDir.exists() && !cacheDir.mkdirs()) {
|
|
||||||
|
if (!cacheDir.exists()) {
|
||||||
|
if (!cacheDir.mkdirs() && !cacheDir.exists()) {
|
||||||
throw new IllegalStateException("failed to create cache dir: " + dir);
|
throw new IllegalStateException("failed to create cache dir: " + dir);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return cacheDir;
|
return cacheDir;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user