Skip to content

Commit 4c5b864

Browse files
author
YangSen-qn
committed
change dns cache file create logic
1 parent 228884a commit 4c5b864

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

library/src/main/java/com/qiniu/android/storage/persistent/DnsCacheFile.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ public class DnsCacheFile implements Recorder {
2020
public DnsCacheFile(String directory) throws IOException {
2121
this.directory = directory;
2222
f = new File(directory);
23-
if (!f.isDirectory() || !f.exists()) {
23+
24+
if (!f.isDirectory()) {
25+
throw new IOException("does not mkdir");
26+
}
27+
28+
if (!f.exists()) {
2429
boolean r = f.mkdirs();
2530
if (!r) {
2631
throw new IOException("mkdir failed");
2732
}
28-
return;
29-
}
30-
if (!f.isDirectory()) {
31-
throw new IOException("does not mkdir");
3233
}
3334
}
3435

0 commit comments

Comments
 (0)