1 | if (file != null) {↵ | | 1 | if (file != null) {↵
|
2 | boolean saveFile = true;↵ | | 2 | boolean saveFile = true;↵
|
3 | if (file.exists()) {↵ | | 3 | if (file.exists()) {↵
|
4 | saveFile = JOptionPane.showConfirmDialog(↵ | | 4 | saveFile = JOptionPane.showConfirmDialog(↵
|
5 | _application.getMainFrame(), i18n.GLOBAL_WARNING_FILE_EXISTS,↵ | | 5 | _application.getMainFrame(), i18n.GLOBAL_WARNING_FILE_EXISTS,↵
|
6 | i18n.GLOBAL_TITLE_WARNING, ↵ | | 6 | i18n.GLOBAL_TITLE_WARNING, ↵
|
7 | JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;↵ | | 7 | JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;↵
|
8 | }↵ | | 8 | }↵
|
9 | ↵ | | 9 | ↵
|
10 | if (saveFile) {↵ | | 10 | if (saveFile) {↵
|
11 | Properties prop = new Properties();↵ | | 11 | Properties prop = new Properties();↵
|
12 | prop.put("user", jtextfieldUsername.getText());↵ | | 12 | prop.put("user", jtextfieldUsername.getText());↵
|
13 | prop.put("display.process", jcheckboxDisplayProcess.isSelected() ? "true" : "false");↵ | | 13 | prop.put("display.process", jcheckboxDisplayProcess.isSelected() ? "true" : "false");↵
|
14 | prop.put("backup.server", jtextfieldBckDBHost.getText());↵ | | 14 | prop.put("restore.server", jtextfieldResDBHost.getText());↵
|
15 | prop.put("backup.port", jtextfieldBckPort.getText());↵ | | 15 | prop.put("restore.port", jtextfieldResPort.getText());↵
|
16 | prop.put("backup.dbfile", jtextfieldBckDBFile.getText());↵ | | 16 | prop.put("restore.dbfile", jtextfieldResDBFile.getText());↵
|
17 | prop.put("backup.checksums", jcheckboxBckIgnoreChecksum.isSelected() ? "true" : "false");↵ | | 17 | prop.put("restore.indexes", jcheckboxResDeactivateIndexes.isSelected() ? "true" : "false");↵
|
18 | prop.put("backup.metadata", jcheckboxBckMetadataOnly.isSelected() ? "true" : "false");↵ | | 18 | prop.put("restore.shadows", jcheckboxResWithoutShadows.isSelected() ? "true" : "false");↵
|
19 | prop.put("backup.oldstyle", jcheckboxBckOldMetadata.isSelected() ? "true" : "false");↵ | | 19 | prop.put("restore.allspace", jcheckboxResUseAllSpace.isSelected() ? "true" : "false");↵
|
20 | prop.put("backup.transportable", jcheckboxBckTransportable.isSelected() ? "true" : "false");↵ | | 20 | prop.put("restore.onetable", jcheckboxResOneTableAtTime.isSelected() ? "true" : "false");↵
|
21 | prop.put("backup.limbo", jcheckboxBckIgnoreLimbo.isSelected() ? "true" : "false");↵ | | 21 | prop.put("restore.validity", jcheckboxResWithoutValidity.isSelected() ? "true" : "false");↵
|
22 | prop.put("backup.garbarge", jcheckboxBckGarbageCollection.isSelected() ? "true" : "false");↵ | | 22 | prop.put("restore.replace", jcheckboxResReplaceDatabase.isSelected() ? "true" : "false");↵
|
23 | prop.put("backup.totables", jcheckboxBckConvertToTables.isSelected() ? "true" : "false");↵ | | 23 | prop.put("restore.setpagesize", jcheckboxResPageSize.isSelected() ? "true" : "false");↵
|
24 | prop.put("backup.nocompression", jcheckboxBckNoDataCompression.isSelected() ? "true" : "false");↵ | | 24 | prop.put("restore.newpagesize", jtextfieldPageSize.getText());↵
|
|
25 | try {↵ | | 25 | try {↵
|
26 | prop.store(new FileOutputStream(file),↵ | | 26 | prop.store(new FileOutputStream(file),↵
|
27 | "FirebirdManager - Backup properties");↵ | | 27 | "FirebirdManager - Restore properties");↵
|
28 | } catch (FileNotFoundException e) {↵ | | 28 | } catch (FileNotFoundException e) {↵
|
29 | JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.SAVE_PROP_FAILED);↵ | | 29 | JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.SAVE_PROP_FAILED);↵
|
30 | log.error(e.getLocalizedMessage());↵ | | 30 | log.error(e.getLocalizedMessage());↵
|
31 | } catch (IOException e) {↵ | | 31 | } catch (IOException e) {↵
|
32 | JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.SAVE_PROP_FAILED);↵ | | 32 | JOptionPane.showMessageDialog(_application.getMainFrame(), i18n.SAVE_PROP_FAILED);↵
|
33 | log.error(e.getLocalizedMessage()) | | 33 | log.error(e.getLocalizedMessage())
|