Skip to content

Commit 0094c6f

Browse files
author
yangsen
committed
auto zone isValid: all zones max be valid
1 parent a9653d4 commit 0094c6f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

library/src/main/java/com/qiniu/android/common/ZonesInfo.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,18 @@ public static ZonesInfo createZonesInfo(JSONObject jsonObject, int actionType) {
8383
}
8484

8585
public boolean isValid() {
86-
return zonesInfo != null && zonesInfo.size() > 0 && zonesInfo.get(0).isValid();
86+
if (zonesInfo == null || zonesInfo.size() == 0) {
87+
return false;
88+
}
89+
90+
boolean valid = true;
91+
for (ZoneInfo info : zonesInfo) {
92+
if (!info.isValid()) {
93+
valid = false;
94+
break;
95+
}
96+
}
97+
return valid;
8798
}
8899

89100
// 是否为临时 zone, 临时 zone,不建议长期使用

0 commit comments

Comments
 (0)