private static boolean validateOldConfigDir( @Nullable File installationHome, @Nullable File oldConfigDir, @NotNull ConfigImportSettings settings) { if (oldConfigDir == null) { if (installationHome != null) { JOptionPane.showMessageDialog( JOptionPane.getRootFrame(), ApplicationBundle.message( "error.invalid.installation.home", installationHome.getAbsolutePath(), settings.getProductName(ThreeState.YES))); } return false; } if (!oldConfigDir.exists()) { JOptionPane.showMessageDialog( JOptionPane.getRootFrame(), ApplicationBundle.message("error.no.settings.path", oldConfigDir.getAbsolutePath()), ApplicationBundle.message("title.settings.import.failed"), JOptionPane.WARNING_MESSAGE); return false; } return true; }
private static void doImport( @NotNull File newConfigDir, @NotNull File oldConfigDir, ConfigImportSettings settings, File installationHome) { try { copy(oldConfigDir, newConfigDir, settings, installationHome); } catch (IOException e) { JOptionPane.showMessageDialog( JOptionPane.getRootFrame(), ApplicationBundle.message("error.unable.to.import.settings", e.getMessage()), ApplicationBundle.message("title.settings.import.failed"), JOptionPane.WARNING_MESSAGE); } }