|
|
@ -7,10 +7,10 @@ import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.stable.ProductConstants; |
|
|
|
|
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.AbstractAction; |
|
|
|
import javax.swing.AbstractAction; |
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
@ -45,7 +45,7 @@ public class RestoreResultDialog extends JDialog { |
|
|
|
initCommonComponents(); |
|
|
|
initCommonComponents(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public RestoreResultDialog(Frame parent, boolean modal, String jarDir) { |
|
|
|
RestoreResultDialog(Frame parent, boolean modal, String jarDir) { |
|
|
|
super(parent, modal); |
|
|
|
super(parent, modal); |
|
|
|
this.jarRestoreDir = jarDir; |
|
|
|
this.jarRestoreDir = jarDir; |
|
|
|
if (ComparatorUtils.equals(jarDir, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Restore_Old_Version"))) { |
|
|
|
if (ComparatorUtils.equals(jarDir, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Restore_Old_Version"))) { |
|
|
@ -100,7 +100,7 @@ public class RestoreResultDialog extends JDialog { |
|
|
|
this.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Jar_Restore")); |
|
|
|
this.setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Jar_Restore")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean deletePreviousPropertyFile() { |
|
|
|
static boolean deletePreviousPropertyFile() { |
|
|
|
File moveFile = new File(RestartHelper.MOVE_FILE); |
|
|
|
File moveFile = new File(RestartHelper.MOVE_FILE); |
|
|
|
File delFile = new File(RestartHelper.RECORD_FILE); |
|
|
|
File delFile = new File(RestartHelper.RECORD_FILE); |
|
|
|
if (StableUtils.mkdirs(moveFile) && StableUtils.mkdirs(delFile)) { |
|
|
|
if (StableUtils.mkdirs(moveFile) && StableUtils.mkdirs(delFile)) { |
|
|
@ -159,7 +159,7 @@ public class RestoreResultDialog extends JDialog { |
|
|
|
|
|
|
|
|
|
|
|
private void putJarBackupFiles() { |
|
|
|
private void putJarBackupFiles() { |
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
java.util.List<String> list = new ArrayList<>(); |
|
|
|
List<String> list = new ArrayList<>(); |
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
|
|
|
|
|
|
|
|
putJarBackupFilesToInstallLib(installHome, map, list); |
|
|
|
putJarBackupFilesToInstallLib(installHome, map, list); |
|
|
@ -168,23 +168,29 @@ public class RestoreResultDialog extends JDialog { |
|
|
|
RestartHelper.saveFilesWhichToDelete(list.toArray(new String[list.size()])); |
|
|
|
RestartHelper.saveFilesWhichToDelete(list.toArray(new String[list.size()])); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void putJarBackupFilesToInstallLib(String installHome, Map<String, String> map, java.util.List<String> list) { |
|
|
|
private void putJarBackupFilesToInstallLib(String installHome, Map<String, String> map, List<String> list) { |
|
|
|
List<String> files = UpdateConstants.JARS_FOR_DESIGNER_X; |
|
|
|
|
|
|
|
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; |
|
|
|
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; |
|
|
|
for (String file : files) { |
|
|
|
File installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.DESIGNERBACKUPPATH)); |
|
|
|
map.put(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, file), |
|
|
|
File[] files = installLib.listFiles(); |
|
|
|
StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file)); |
|
|
|
if (files != null) { |
|
|
|
list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file)); |
|
|
|
for (File file : files) { |
|
|
|
|
|
|
|
map.put(file.getAbsolutePath(), |
|
|
|
|
|
|
|
StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); |
|
|
|
|
|
|
|
list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void putJarBackupFilesToInstallEnv(String installHome, Map<String, String> map, java.util.List<String> list) { |
|
|
|
private void putJarBackupFilesToInstallEnv(String installHome, Map<String, String> map, List<String> list) { |
|
|
|
List<String> files = UpdateConstants.JARS_FOR_SERVER_X; |
|
|
|
|
|
|
|
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; |
|
|
|
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; |
|
|
|
for (String file : files) { |
|
|
|
File installEnv = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.BACKUPPATH)); |
|
|
|
map.put(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, file), |
|
|
|
File[] files = installEnv.listFiles(); |
|
|
|
StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); |
|
|
|
if (files != null) { |
|
|
|
list.add(StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); |
|
|
|
for (File file : files) { |
|
|
|
|
|
|
|
map.put(file.getAbsolutePath(), |
|
|
|
|
|
|
|
StableUtils.pathJoin(WorkContext.getCurrent().getPath(), ProjectConstants.LIB_NAME, file.getName())); |
|
|
|
|
|
|
|
list.add(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), ProjectConstants.LIB_NAME, file.getName())); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |