mirror of
https://github.com/Wisser/Jailer.git
synced 2026-04-27 07:17:28 -05:00
removed obsolete imports
This commit is contained in:
@@ -1784,19 +1784,29 @@ public class DbConnectionDialog extends javax.swing.JDialog {
|
||||
}
|
||||
}
|
||||
|
||||
private static String OBFUSCATED_MARKER_PREFIX = "encrypted:";
|
||||
// TODO
|
||||
// TODO test non-obf. connections.csv
|
||||
|
||||
public static void saveAsCSV(Collection<ConnectionInfo> infos, File file) throws IOException {
|
||||
StringObfuscator stringObfuscator = new StringObfuscator();
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
||||
writer.append("# Jailer Database connections. (CSV format. escape sequence: '\"' -> '\\\"' and '\\' -> '\\\\')" + UIUtil.LINE_SEPARATOR);
|
||||
writer.append("# Name; User; URL; Data model folder; Connection type (Development/Test/Staging or Production); Password (plain); Password (obfuscated); Driver class; Driver JAR; additional JAR 1; additional JAR 2; additional JAR 3; additional JAR 4;" + UIUtil.LINE_SEPARATOR);
|
||||
writer.append("# Jailer Database connections." + UIUtil.LINE_SEPARATOR);
|
||||
writer.append(UIUtil.LINE_SEPARATOR);
|
||||
writer.append("# Format: CVS, columns are separated by ';'" + UIUtil.LINE_SEPARATOR);
|
||||
writer.append("# Lines starting with '#' and empty lines are comments" + UIUtil.LINE_SEPARATOR);
|
||||
writer.append("# Escape sequences: '\"' -> '\\\"' and '\\' -> '\\\\'" + UIUtil.LINE_SEPARATOR);
|
||||
writer.append("# Passwords and URLs starting with '" + OBFUSCATED_MARKER_PREFIX + "' are encrypted." + UIUtil.LINE_SEPARATOR);
|
||||
writer.append("# You may use non-encrypted text here by omitting the prefix." + UIUtil.LINE_SEPARATOR);
|
||||
writer.append(UIUtil.LINE_SEPARATOR);
|
||||
writer.append("# Name; User; URL; Data model folder; Connection type (Development/Test/Staging/Production or empty); Password; Driver class; Driver JAR; additional JAR 1; additional JAR 2; additional JAR 3; additional JAR 4;" + UIUtil.LINE_SEPARATOR);
|
||||
for (ConnectionInfo ci: infos) {
|
||||
writer.append(CsvFile.encodeCell(ci.alias) + "; ");
|
||||
writer.append(CsvFile.encodeCell(ci.user) + "; ");
|
||||
writer.append(CsvFile.encodeCell(ci.url) + "; ");
|
||||
writer.append(OBFUSCATED_MARKER_PREFIX + CsvFile.encodeCell(stringObfuscator.encrypt(ci.url)) + "; ");
|
||||
writer.append(CsvFile.encodeCell(ci.dataModelFolder) + "; ");
|
||||
writer.append(CsvFile.encodeCell(ci.getConnectionType().name()) + "; ");
|
||||
writer.append("; ");
|
||||
writer.append(CsvFile.encodeCell(stringObfuscator.encrypt(ci.password)) + "; ");
|
||||
writer.append(OBFUSCATED_MARKER_PREFIX + CsvFile.encodeCell(stringObfuscator.encrypt(ci.password)) + "; ");
|
||||
writer.append(CsvFile.encodeCell(ci.driverClass) + "; ");
|
||||
writer.append(CsvFile.encodeCell(ci.jar1) + "; ");
|
||||
writer.append(CsvFile.encodeCell(ci.jar2) + "; ");
|
||||
@@ -1816,17 +1826,20 @@ public class DbConnectionDialog extends javax.swing.JDialog {
|
||||
ci.alias = line.cells.get(0);
|
||||
ci.user = line.cells.get(1);
|
||||
ci.url = line.cells.get(2);
|
||||
if (ci.url.startsWith(OBFUSCATED_MARKER_PREFIX)) {
|
||||
ci.url = stringObfuscator.decrypt(ci.url.substring(OBFUSCATED_MARKER_PREFIX.length()));
|
||||
}
|
||||
ci.dataModelFolder = line.cells.get(3);
|
||||
ci.connectionTypeName = line.cells.get(4);
|
||||
ci.password = line.cells.get(5);
|
||||
if (ci.password.isEmpty() && !line.cells.get(6).isEmpty()) {
|
||||
ci.password = stringObfuscator.decrypt(line.cells.get(6));
|
||||
if (ci.password.startsWith(OBFUSCATED_MARKER_PREFIX)) {
|
||||
ci.password = stringObfuscator.decrypt(ci.password.substring(OBFUSCATED_MARKER_PREFIX.length()));
|
||||
}
|
||||
ci.driverClass = line.cells.get(7);
|
||||
ci.jar1 = line.cells.get(8);
|
||||
ci.jar2 = line.cells.get(9);
|
||||
ci.jar3 = line.cells.get(10);
|
||||
ci.jar4 = line.cells.get(11);
|
||||
ci.driverClass = line.cells.get(6);
|
||||
ci.jar1 = line.cells.get(7);
|
||||
ci.jar2 = line.cells.get(8);
|
||||
ci.jar3 = line.cells.get(9);
|
||||
ci.jar4 = line.cells.get(10);
|
||||
list.add(ci);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ import java.util.zip.ZipOutputStream;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
@@ -263,6 +262,7 @@ public class ExportPanel extends javax.swing.JPanel {
|
||||
}
|
||||
}
|
||||
}
|
||||
updateStatus();
|
||||
UIUtil.initComponents(this);
|
||||
} finally {
|
||||
DataModelManager.setCurrentModelSubfolder(cmsf, connectionDialog.executionContext);
|
||||
@@ -433,7 +433,6 @@ public class ExportPanel extends javax.swing.JPanel {
|
||||
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
||||
if (!selectedConnections.isEmpty() || !selectedModels.isEmpty()) {
|
||||
doExport();
|
||||
|
||||
}
|
||||
ok = true;
|
||||
dialog.setVisible(false);
|
||||
@@ -457,7 +456,7 @@ public class ExportPanel extends javax.swing.JPanel {
|
||||
if (cFile != null) {
|
||||
cFile.delete();
|
||||
}
|
||||
JOptionPane.showMessageDialog(this, okMessage);
|
||||
JOptionPane.showMessageDialog(this, okMessage);
|
||||
} catch (IOException e) {
|
||||
UIUtil.showException(this, "Error", e);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.sf.jailer.configuration.DBMS;
|
||||
import net.sf.jailer.database.Session;
|
||||
import net.sf.jailer.database.Session.AbstractResultSetReader;
|
||||
import net.sf.jailer.datamodel.Column;
|
||||
|
||||
@@ -149,6 +149,7 @@ import net.sf.jailer.datamodel.Table;
|
||||
import net.sf.jailer.modelbuilder.JDBCMetaDataBasedModelElementFinder;
|
||||
import net.sf.jailer.modelbuilder.MemorizedResultSet;
|
||||
import net.sf.jailer.ui.DbConnectionDialog;
|
||||
import net.sf.jailer.ui.DbConnectionDialog.ConnectionType;
|
||||
import net.sf.jailer.ui.Environment;
|
||||
import net.sf.jailer.ui.JComboBox2;
|
||||
import net.sf.jailer.ui.QueryBuilderDialog;
|
||||
@@ -156,7 +157,6 @@ import net.sf.jailer.ui.QueryBuilderDialog.Relationship;
|
||||
import net.sf.jailer.ui.SessionForUI;
|
||||
import net.sf.jailer.ui.StringSearchPanel.StringSearchDialog;
|
||||
import net.sf.jailer.ui.UIUtil;
|
||||
import net.sf.jailer.ui.DbConnectionDialog.ConnectionType;
|
||||
import net.sf.jailer.ui.UIUtil.PLAF;
|
||||
import net.sf.jailer.ui.associationproposer.AssociationProposerView;
|
||||
import net.sf.jailer.ui.databrowser.BrowserContentCellEditor;
|
||||
|
||||
Reference in New Issue
Block a user