Skip to content

Commit

Permalink
region support set uc host
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSen-qn committed Nov 21, 2023
1 parent 9823f99 commit 0ea1d36
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/com/qiniu/storage/Region.java
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ String getApiHost(RegionReqInfo regionReqInfo) throws QiniuException {
}

String getUcHost(RegionReqInfo regionReqInfo) throws QiniuException {
if (ucHosts == null || ucHosts.size() == 0) {
if (ucHosts == null || ucHosts.isEmpty()) {
return "";
}
return ucHosts.get(0);
Expand Down Expand Up @@ -470,6 +470,13 @@ public Builder apiHost(String apiHost) {
return this;
}

public Builder ucHost(String... ucHosts) {
if (ucHosts.length > 0) {
this.region.ucHosts = Arrays.asList(ucHosts);
}
return this;
}

/**
* 自动选择,其它参数设置无效
*
Expand Down

0 comments on commit 0ea1d36

Please sign in to comment.