|
|
|
@ -9,6 +9,8 @@ import com.fr.design.env.DesignerWorkspaceInfo;
|
|
|
|
|
import com.fr.design.env.DesignerWorkspaceType; |
|
|
|
|
import com.fr.design.env.RemoteWorkspace; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.env.VersionCheckMessageDialog; |
|
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
|
import com.fr.general.CommonIOUtils; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
@ -45,7 +47,10 @@ import java.io.InputStream;
|
|
|
|
|
import java.lang.reflect.Method; |
|
|
|
|
import java.net.ProtocolException; |
|
|
|
|
import java.net.URI; |
|
|
|
|
import java.text.ParsePosition; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.HashSet; |
|
|
|
|
import java.util.List; |
|
|
|
@ -78,6 +83,13 @@ public class VersionCheckUtils {
|
|
|
|
|
return checkLocalAndRemoteJartime(selectedEnv) && checkLocalAndRemotePlugin().size() == 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void showVersionCheckDialog(String envName){ |
|
|
|
|
if(!VersionCheckUtils.versionCheck(envName)){ |
|
|
|
|
VersionCheckMessageDialog versionCheckMessageDialog = new VersionCheckMessageDialog(DesignerContext.getDesignerFrame(),Toolkit.i18nText("Fine-Design_Basic_Sync_Check_Brief_Info"),envName); |
|
|
|
|
versionCheckMessageDialog.setVisible(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static boolean checkLocalAndRemoteJartime(String envName) { |
|
|
|
|
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); |
|
|
|
|
DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(envName); |
|
|
|
@ -197,14 +209,13 @@ public class VersionCheckUtils {
|
|
|
|
|
/** |
|
|
|
|
* 格式化分支版本号 |
|
|
|
|
* |
|
|
|
|
* @param branch 初始的分支版本号 |
|
|
|
|
* @param buildNO 初始的分支版本号 |
|
|
|
|
* @return 格式化后的版本号 |
|
|
|
|
*/ |
|
|
|
|
private static String formatBranch(String branch) { |
|
|
|
|
if (branch.contains("#")) { |
|
|
|
|
return branch.substring(branch.lastIndexOf("-") + 1, branch.length() - 13); |
|
|
|
|
} |
|
|
|
|
return branch; |
|
|
|
|
private static String formatBranch(String buildNO) { |
|
|
|
|
Date jarDate = (new SimpleDateFormat("yyyy.MM.dd")).parse(buildNO, new ParsePosition(buildNO.indexOf("-") + 1)); |
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
return df.format(jarDate); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) { |
|
|
|
@ -361,12 +372,8 @@ public class VersionCheckUtils {
|
|
|
|
|
bean.setDownloadLength(totalBytesRead); |
|
|
|
|
callBack.updateProgress(bean); |
|
|
|
|
} |
|
|
|
|
} catch (ProtocolException e) { |
|
|
|
|
UpdateException exception = new UpdateException(e.getMessage() + " downloadPluginZip Exception in network"); |
|
|
|
|
FineLoggerFactory.getLogger().error(exception.getErrorMessage(), e); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
UpdateException exception = new UpdateException(e.getMessage() + " downloadPluginZip Exception in download"); |
|
|
|
|
FineLoggerFactory.getLogger().error(exception.getErrorMessage(), e); |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} finally { |
|
|
|
|