Browse Source

Merge pull request #532 in BA/design from ~LEE/design:dev to dev

* commit 'a1d72bb047f93f95342e00a328b60561abde0218':
  REPORT-809 设计器插件管理点击全部更新会提示连接应用商店失败
  1
  1
master
superman 8 years ago
parent
commit
a07aec20fe
  1. 14
      designer_base/src/com/fr/design/extra/PluginHelper.java

14
designer_base/src/com/fr/design/extra/PluginHelper.java

@ -15,6 +15,7 @@ import com.fr.plugin.dependence.PluginDependenceUnit;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.xml.XMLTools;
@ -47,6 +48,9 @@ public class PluginHelper {
* @param p 下载百分比处理
*/
public static void downloadPluginFile(String id, String username, String password, Process<Double> p) throws Exception {
if (!PluginHelper.invalidUser(id, username, password)) {
return;
}
HttpClient httpClient = new HttpClient(getDownloadPath(id, username, password));
if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) {
int totalSize = httpClient.getContentLength();
@ -72,6 +76,16 @@ public class PluginHelper {
}
}
private static boolean invalidUser(String id, String username, String password) {
if (StringUtils.isEmpty(id)) {
return false;
} else if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)){
return false;
} else {
return true;
}
}
private static String getDownloadPath(String id, String username, String password) throws Exception {
HashMap<String, String> map = new HashMap<String, String>();
map.put("id", id);

Loading…
Cancel
Save