Skip to content

Commit 46fed00

Browse files
authored
Merge pull request #485 from YangSen-qn/develop
add ap-northeast-1
2 parents bc39ba1 + 9f7651d commit 46fed00

File tree

5 files changed

+31
-20
lines changed

5 files changed

+31
-20
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#Changelog
2+
## 8.5.1(2022-10-21)
3+
* 移除雾存储区域:华东一区
4+
* 新增首尔和华东浙江 2 区 Region
5+
* 优化分片上传 ctx 超时检测
6+
* Configuration: 增加 writeTimeout 配置属性,用于配置 tcp 写超时
27

38
## 8.5.0(2022-08-25)
49
* 支持自定义 request client

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ https://github.com/qiniudemo/qiniu-lab-android
1515

1616
| Qiniu SDK 版本 | 最低 Android版本 | 依赖库版本 |
1717
|------------ |-----------------|------------------------|
18+
| 8.5.1 | Android 4.0+ | okhttp 4+ |
1819
| 8.5.0 | Android 4.0+ | okhttp 4+ |
1920
| 8.4.* | Android 4.0+ | okhttp 4+ |
2021
| 8.3.2 | Android 4.0+ | okhttp 4+ |
@@ -34,7 +35,7 @@ https://github.com/qiniudemo/qiniu-lab-android
3435
| 7.0.7 | Android 2.2+ | android-async-http 1.4.8 |
3536

3637
### 注意
37-
* 推荐使用最新版:8.5.0
38+
* 推荐使用最新版:8.5.1
3839
* 7.6.2 ~ 8.3.2 AndroidNetwork.getMobileDbm()可以获取手机信号强度,需要如下权限(API>=18时生效)
3940
```
4041
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

library/src/androidTest/java/com/qiniu/android/TestConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public final class TestConfig {
1010
// TODO: 2020-05-09 bad token for testPutBytesWithFixedZoneUseBackupDomains
1111
// 华东上传凭证
1212
public static final String bucket_z0 = "kodo-phone-zone0-space";
13+
1314
public static final String token_z0 = "dxVQk8gyk3WswArbNhdKIwmwibJ9nFsQhMNUmtIM:Qxeb7v5PXIrih_gwR-6pD1KsGgg=:eyJzY29wZSI6ImtvZG8tcGhvbmUtem9uZTAtc3BhY2UiLCJkZWFkbGluZSI6MTY2OTUzNDk3OCwgInJldHVybkJvZHkiOiJ7XCJmb29cIjokKHg6Zm9vKSwgXCJiYXJcIjokKHg6YmFyKSwgXCJtaW1lVHlwZVwiOiQobWltZVR5cGUpLCBcImhhc2hcIjokKGV0YWcpLCBcImtleVwiOiQoa2V5KSwgXCJmbmFtZVwiOiQoZm5hbWUpfSJ9";
1415
// 华北上传凭证
1516
public static final String bucket_z1 = "kodo-phone-zone1-space";

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

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ public final class FixedZone extends Zone {
1919
new String[]{"upload.qbox.me", "up.qbox.me"},
2020
"z0");
2121

22+
/**
23+
* 华东浙江 2 机房
24+
*/
25+
public static final Zone zoneCnEast2 = new FixedZone(new String[]{"upload-cn-east-2.qiniup.com", "up-cn-east-2.qiniup.com"},
26+
null,
27+
"cn-east-2");
28+
2229
/**
2330
* 华北机房
2431
*/
@@ -33,6 +40,13 @@ public final class FixedZone extends Zone {
3340
new String[]{"upload-z2.qbox.me", "up-z2.qbox.me"},
3441
"z2");
3542

43+
/**
44+
* 首尔机房
45+
*/
46+
public static final Zone zoneApNorthEast1 = new FixedZone(new String[]{"upload-ap-northeast-1.qiniup.com", "up-ap-northeast-1.qiniup.com"},
47+
null,
48+
"ap-northeast-1");
49+
3650
/**
3751
* 北美机房
3852
*/
@@ -47,29 +61,16 @@ public final class FixedZone extends Zone {
4761
new String[]{"upload-as0.qbox.me", "up-as0.qbox.me"},
4862
"as0");
4963

50-
/**
51-
* zone fog-cn-east-1 雾存储 华东-1
52-
* 分片上传暂时仅支持分片 api v2
53-
* 分片 api v2设置方式:配置 Configuration 的 resumeUploadVersion 为 Configuration.RESUME_UPLOAD_VERSION_V2
54-
* eg:
55-
* Configuration configuration = new Configuration.Builder()
56-
* .resumeUploadVersion(Configuration.RESUME_UPLOAD_VERSION_V2)
57-
* .build();
58-
*
59-
* @return 实例
60-
*/
61-
public static final Zone zoneFogCnEast1 = new FixedZone(new String[]{"upload-fog-cn-east-1.qiniup.com", "up-fog-cn-east-1.qiniup.com"},
62-
new String[]{"upload-fog-cn-east-1.qiniup.com", "up-fog-cn-east-1.qiniup.com"},
63-
"fog-cn-east-1");
64-
6564
private ZonesInfo zonesInfo;
6665

6766
public static FixedZone localsZoneInfo() {
6867
ArrayList<FixedZone> localsZone = new ArrayList<>();
6968
localsZone.add((FixedZone)zone0);
69+
localsZone.add((FixedZone)zoneCnEast2);
7070
localsZone.add((FixedZone)zone1);
7171
localsZone.add((FixedZone)zone2);
7272
localsZone.add((FixedZone)zoneNa0);
73+
localsZone.add((FixedZone)zoneApNorthEast1);
7374
localsZone.add((FixedZone)zoneAs0);
7475

7576
ArrayList<ZoneInfo> zoneInfoArray = new ArrayList<>();
@@ -115,9 +116,12 @@ private ZonesInfo createZonesInfo(String[] upDomains,
115116

116117
List<String> upDomainsList = new ArrayList<String>(Arrays.asList(upDomains));
117118
List<String> oldUpDomainsList = null;
118-
if (oldUpDomains != null){
119+
if (oldUpDomains != null && oldUpDomains.length > 0){
119120
oldUpDomainsList = new ArrayList<String>(Arrays.asList(oldUpDomains));
121+
} else {
122+
oldUpDomainsList = new ArrayList<>();
120123
}
124+
121125
ZoneInfo zoneInfo = ZoneInfo.buildInfo(upDomainsList, oldUpDomainsList, regionId);
122126
if (zoneInfo == null) {
123127
return null;

library/src/main/java/com/qiniu/android/storage/KeyGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
*/
88
public interface KeyGenerator {
99
/**
10-
* 根据服务器的key和本地文件名生成持久化纪录的key
10+
* 根据服务器的 key 和本地文件名生成持久化纪录的 key
1111
*
12-
* @param key 服务器的key
12+
* @param key 服务器的 key
1313
* @param file 本地文件名
14-
* @return 持久化上传纪录的key
14+
* @return 持久化上传纪录的 key
1515
*/
1616
@Deprecated
1717
String gen(String key, File file);

0 commit comments

Comments
 (0)