Browse Source

Merge pull request #753 in DESIGN/design from ~KERRY/design_10.0:release/10.0 to release/10.0

* commit 'd40dc6c52ee4e8f23f9daf1ba9baa2e3a671a304':
  REPORT-13225 移动插件脚本下载位置,并删除无用temp文件
bugfix/10.0
kerry 6 years ago
parent
commit
6f77882918
  1. 8
      designer-base/src/main/java/com/fr/design/extra/PluginConstants.java
  2. 7
      designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java
  3. 2
      designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java

8
designer-base/src/main/java/com/fr/design/extra/PluginConstants.java

@ -1,14 +1,14 @@
package com.fr.design.extra;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
/**
* Created by ibm on 2017/5/25.
*/
public class PluginConstants {
public static final int BYTES_NUM = 1024;
private static final String TEMP_PATH = System.getProperty("user.dir") + "/tmp";
public static final String DOWNLOAD_PATH = System.getProperty("user.dir") + "/download";
//插件依赖的下载位置
public static final String DEPENDENCE_DOWNLOAD_PATH = System.getProperty("user.dir") + "/download/dependence";
public static final String DOWNLOAD_PATH = StableUtils.pathJoin(WorkContext.getCurrent().getPath() + "/cache");
public static final String TEMP_FILE = "temp.zip";
public static final String CONNECTION_404 = "404";

7
designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

@ -16,6 +16,7 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginStoreConstants;
import com.fr.plugin.PluginVerifyException;
import com.fr.stable.CommonUtils;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
@ -280,7 +281,11 @@ public class WebViewDlgHelper {
try {
if (get()) {
IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome);
File scriptZip = new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE));
if(scriptZip.exists()){
IOUtils.unzip(scriptZip, installHome);
CommonUtils.deleteFile(scriptZip);
}
PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE);
}

2
designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java

@ -10,6 +10,7 @@ import com.fr.general.IOUtils;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient;
import com.fr.plugin.chart.DownloadSourcesEvent;
import com.fr.stable.CommonUtils;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
@ -140,6 +141,7 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
if (result) {
//安装文件
IOUtils.unZipFilesGBK(temp, StableUtils.pathJoin(WorkContext.getCurrent().getPath(), siteInfo.localDir));
CommonUtils.deleteFile(file);
}
} else {
result = false;

Loading…
Cancel
Save