|
@@ -77,8 +77,6 @@ public class UpYunClient {
|
|
|
|
|
|
private RequestConfig requestConfig;
|
|
|
|
|
|
- private Boolean test;
|
|
|
-
|
|
|
private String testUrl;
|
|
|
|
|
|
/**
|
|
@@ -101,13 +99,7 @@ public class UpYunClient {
|
|
|
this.password = password;
|
|
|
this.md5Password = md5(password);
|
|
|
|
|
|
- test = PropertiesUtil.getBoolean("$upyun.test", false);
|
|
|
- if (test) {
|
|
|
- testUrl = PropertiesUtil.getString("$upyun.testUrl");
|
|
|
- if (null == testUrl) {
|
|
|
- throw new ExamCloudRuntimeException("$upyun.testUrl is not configured.");
|
|
|
- }
|
|
|
- }
|
|
|
+ testUrl = PropertiesUtil.getString("$upyun.testUrl");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -142,7 +134,7 @@ public class UpYunClient {
|
|
|
public String writeFile(String filePath, InputStream in) {
|
|
|
String path = formatPath(filePath);
|
|
|
String url = "http://" + API_DOMAIN + path;
|
|
|
- if (test) {
|
|
|
+ if (filePath.endsWith(".test___")) {
|
|
|
url = testUrl;
|
|
|
}
|
|
|
|