Browse Source

REPORT-23155 解决从新版本退回到老版本的还原按钮问题

feature/big-screen
Bryant 5 years ago
parent
commit
091d310f3f
  1. 26
      designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java

26
designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java

@ -161,13 +161,13 @@ public class RestoreResultDialog extends JDialog {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
String installHome = StableUtils.getInstallHome(); String installHome = StableUtils.getInstallHome();
putJarBackupFilesToInstallLib(installHome, map, list); filesToMove(installHome, map);
putJarBackupFilesToInstallEnv(list); filesToDelete(installHome, list);
RestartHelper.saveFilesWhichToMove(map); RestartHelper.saveFilesWhichToMove(map);
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, List<String> list) { private void filesToMove(String installHome, Map<String, String> map) {
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR;
String envHome = WorkContext.getCurrent().getPath(); String envHome = WorkContext.getCurrent().getPath();
File installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.DESIGNERBACKUPPATH)); File installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.DESIGNERBACKUPPATH));
@ -203,18 +203,9 @@ public class RestoreResultDialog extends JDialog {
} }
} }
} }
installLib = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME));
files = installLib.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().equals(UpdateConstants.ASPECTJRT)) {
list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName()));
}
}
}
} }
private void putJarBackupFilesToInstallEnv(List<String> list) { private void filesToDelete(String installHome, List<String> list) {
String envHome = WorkContext.getCurrent().getPath(); String envHome = WorkContext.getCurrent().getPath();
File installEnv = new File(StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME)); File installEnv = new File(StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME));
File[] files = installEnv.listFiles(); File[] files = installEnv.listFiles();
@ -225,5 +216,14 @@ public class RestoreResultDialog extends JDialog {
} }
} }
} }
installEnv = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME));
files = installEnv.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().equals(UpdateConstants.ASPECTJRT)) {
list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName()));
}
}
}
} }
} }
Loading…
Cancel
Save