diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser new file mode 100644 index 000000000..d58f41d78 Binary files /dev/null and b/.idea/caches/gradle_models.ser differ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 30aa626c2..ae78c113f 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,29 +1,113 @@ - - - - - - - - - - + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
\ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 94946c6a8..1715e3b95 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -12,6 +12,7 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index e0d5b93ff..10b5291fa 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,7 +5,7 @@ - + diff --git a/android-sdk.iml b/android-sdk.iml index ad4065b84..74149ab95 100644 --- a/android-sdk.iml +++ b/android-sdk.iml @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index ac07e981e..449d631e8 100755 --- a/library/build.gradle +++ b/library/build.gradle @@ -46,7 +46,7 @@ android { } dependencies { - compile 'com.squareup.okhttp3:okhttp:3.11.0' + compile 'com.squareup.okhttp3:okhttp:3.12.6' // for javax.annotation.Nullable use in custom MultipartBody and Headers implements. // compile 'com.google.code.findbugs:jsr305:3.0.2' compile fileTree(include: ['*.jar'], dir: 'libs') diff --git a/library/library.iml b/library/library.iml index d14856797..6b01e6472 100644 --- a/library/library.iml +++ b/library/library.iml @@ -4,6 +4,8 @@ @@ -17,7 +19,8 @@ \ No newline at end of file diff --git a/library/src/main/java/com/qiniu/android/common/Constants.java b/library/src/main/java/com/qiniu/android/common/Constants.java index 6edfec55e..84950de99 100644 --- a/library/src/main/java/com/qiniu/android/common/Constants.java +++ b/library/src/main/java/com/qiniu/android/common/Constants.java @@ -2,7 +2,7 @@ public final class Constants { - public static final String VERSION = "7.4.2"; + public static final String VERSION = "7.4.3"; public static final String UTF_8 = "utf-8"; } diff --git a/library/src/main/java/com/qiniu/android/storage/persistent/DnsCacheFile.java b/library/src/main/java/com/qiniu/android/storage/persistent/DnsCacheFile.java index d112c5fe6..abd388eaf 100644 --- a/library/src/main/java/com/qiniu/android/storage/persistent/DnsCacheFile.java +++ b/library/src/main/java/com/qiniu/android/storage/persistent/DnsCacheFile.java @@ -15,10 +15,11 @@ public class DnsCacheFile implements Recorder { public String directory; + public File f; public DnsCacheFile(String directory) throws IOException { this.directory = directory; - File f = new File(directory); + f = new File(directory); if (!f.exists()) { boolean r = f.mkdirs(); if (!r) { @@ -39,8 +40,8 @@ public DnsCacheFile(String directory) throws IOException { */ @Override public void set(String key, byte[] data) { - File file = new File(directory); - File[] fs = file.listFiles(); + File[] fs = f.listFiles(); + if (fs == null) return; if (fs.length > 0) { for (int i = 0; i < fs.length; i++) { del(fs[i].getName()); @@ -97,8 +98,8 @@ public byte[] get(String key) { //f.delete()=false时才会有fs.length>1的情况 public String getFileName() { - File file = new File(directory); - File[] fs = file.listFiles(); + File[] fs = f.listFiles(); + if (fs == null) return null; if (fs.length == 1) { return fs[0].getName(); } else if (fs.length > 1) { @@ -107,7 +108,7 @@ public String getFileName() { for (int i = 1; i < fs.length; i++) { String key = fs[i].getName(); DnsCacheKey cacheKey = DnsCacheKey.toCacheKey(key); - if(cacheKey==null) + if (cacheKey == null) return null; long time = Long.parseLong(cacheKey.getCurrentTime()); if (time > cachetime) {