|
@@ -83,6 +83,8 @@ public class UpYunClient {
|
|
|
|
|
|
private boolean unsafe;
|
|
|
|
|
|
+ private String domain;
|
|
|
+
|
|
|
/**
|
|
|
* 构造函数
|
|
|
*
|
|
@@ -90,7 +92,7 @@ public class UpYunClient {
|
|
|
* @param userName
|
|
|
* @param password
|
|
|
*/
|
|
|
- public UpYunClient(String bucketName, String userName, String password) {
|
|
|
+ public UpYunClient(String bucketName, String userName, String password, String domain) {
|
|
|
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
|
|
|
cm.setMaxTotal(1000);
|
|
|
httpclient = HttpClients.custom().setConnectionManager(cm).disableAutomaticRetries()
|
|
@@ -101,6 +103,7 @@ public class UpYunClient {
|
|
|
this.bucketName = bucketName;
|
|
|
this.userName = userName;
|
|
|
this.password = password;
|
|
|
+ this.domain = domain;
|
|
|
this.md5Password = md5(password);
|
|
|
|
|
|
base64Auth = "Basic " + org.apache.commons.codec.binary.Base64
|
|
@@ -190,7 +193,7 @@ public class UpYunClient {
|
|
|
+ " ms.");
|
|
|
}
|
|
|
|
|
|
- String fileUrl = "http://" + bucketName + ".b0.upaiyun.com" + filePath;
|
|
|
+ String fileUrl = this.domain + filePath;
|
|
|
return new UpYunPathInfo(fileUrl, filePath);
|
|
|
}
|
|
|
|