From 0ea1d3624d035c95bf8bf1979019f1b812871708 Mon Sep 17 00:00:00 2001 From: YangSen-qn Date: Tue, 21 Nov 2023 16:30:37 +0800 Subject: [PATCH] region support set uc host --- src/main/java/com/qiniu/storage/Region.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/qiniu/storage/Region.java b/src/main/java/com/qiniu/storage/Region.java index 8765c868c..4d93959cc 100644 --- a/src/main/java/com/qiniu/storage/Region.java +++ b/src/main/java/com/qiniu/storage/Region.java @@ -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); @@ -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; + } + /** * 自动选择,其它参数设置无效 *