diff --git a/out/MendixBackupRestoreTool.exe b/out/MendixBackupRestoreTool.exe index 2a9aa89..2bb012d 100644 Binary files a/out/MendixBackupRestoreTool.exe and b/out/MendixBackupRestoreTool.exe differ diff --git a/out/MendixBackupRestoreTool.jar b/out/MendixBackupRestoreTool.jar index eca7102..ec01fbd 100644 Binary files a/out/MendixBackupRestoreTool.jar and b/out/MendixBackupRestoreTool.jar differ diff --git a/src/main/java/com/ccdg/app/MendixBackupRestoreTool.java b/src/main/java/com/ccdg/app/MendixBackupRestoreTool.java index 0a3835a..8d3d41c 100644 --- a/src/main/java/com/ccdg/app/MendixBackupRestoreTool.java +++ b/src/main/java/com/ccdg/app/MendixBackupRestoreTool.java @@ -3,8 +3,6 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Button; -import java.util.Locale; - import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.List; import org.eclipse.swt.events.SelectionAdapter; diff --git a/src/main/java/com/ccdg/app/MendixUtil.java b/src/main/java/com/ccdg/app/MendixUtil.java index 482f5d8..45b3125 100644 --- a/src/main/java/com/ccdg/app/MendixUtil.java +++ b/src/main/java/com/ccdg/app/MendixUtil.java @@ -631,7 +631,8 @@ public boolean GetBackupList(int selectionCount, String environment ) { for (int i = 0; i < backups.length(); i++) { // if a backup is being created createdon is null if (!backups.getJSONObject(i).isNull(CREATED_ON)) { - backuplist.add(dt1.format(parser.parse(backups.getJSONObject(i).getString(CREATED_ON)))); + backuplist.add(dt1.format(new Date(backups.getJSONObject(i).getLong(CREATED_ON)))); + //backuplist.add(dt1.format(parser.parse(backups.getJSONObject(i).getString(CREATED_ON)))); } } return backups.length() > 0; @@ -674,13 +675,16 @@ public void run() if (apps != null) { String appid = ""; String backupid = ""; - Date createdOn = null; + //Date createdOn = null; + Long createdOn = 0L; try { appid = apps.getJSONObject(AppIndexByListIndex(selectedAppIndex)).getString(APP_ID); backupid = backups.getJSONObject(selectedBackupIndex).getString(SNAPSHOT_ID); // if a backup is being created createdon is null if (!backups.getJSONObject(selectedBackupIndex).isNull(CREATED_ON)) { - createdOn = parseJSONDate(backups.getJSONObject(selectedBackupIndex).getString(CREATED_ON)); + //createdOn = parseJSONDate(backups.getJSONObject(selectedBackupIndex).getString(CREATED_ON)); + createdOn = backups.getJSONObject(selectedBackupIndex).getLong(CREATED_ON); + } } catch (Exception exp) { consoleWrite("Error getting list " + exp.getMessage()); @@ -713,7 +717,7 @@ public void run() return; } dbname = appid + backupid; - dbname = getTargetDatabaseName(appid, environment, createdOn); + dbname = getTargetDatabaseName(appid, environment, new Date(createdOn)); } if (doRestore) { try { @@ -864,10 +868,11 @@ public void run() if (apps != null) { String appid = apps.getJSONObject(AppIndexByListIndex(selectedAppIndex)).getString(APP_ID); String backupid = backups.getJSONObject(selectedBackupIndex).getString(SNAPSHOT_ID); - Date createdOn = null; + Long createdOn = 0L; // if a backup is being created createdon is null if (!backups.getJSONObject(selectedBackupIndex).isNull(CREATED_ON)) { - createdOn = parseJSONDate(backups.getJSONObject(selectedBackupIndex).getString(CREATED_ON)); + createdOn = backups.getJSONObject(selectedBackupIndex).getLong(CREATED_ON); + //createdOn = parseJSONDate(backups.getJSONObject(selectedBackupIndex).getString(CREATED_ON)); } OkHttpClient client = getClient(60); @@ -897,7 +902,7 @@ public void run() return; } dbname = appid + backupid; - dbname = getTargetDatabaseName(appid, environment, createdOn); + dbname = getTargetDatabaseName(appid, environment, new Date(createdOn)); } if (doRestore) { try { diff --git a/src/main/java/com/ccdg/app/SettingsDialog.java b/src/main/java/com/ccdg/app/SettingsDialog.java index a9f056d..9b0aa0d 100644 --- a/src/main/java/com/ccdg/app/SettingsDialog.java +++ b/src/main/java/com/ccdg/app/SettingsDialog.java @@ -142,7 +142,7 @@ public void widgetSelected(SelectionEvent e) { Label lblCopyrightChrisDe = new Label(shlSettings, SWT.NONE); lblCopyrightChrisDe.setToolTipText(""); lblCopyrightChrisDe.setBounds(18, 341, 221, 23); - lblCopyrightChrisDe.setText("V 3.2 - Chris de Gelder"); + lblCopyrightChrisDe.setText("V 3.2.1 - Chris de Gelder"); lblPostgresDirectory = new Label(shlSettings, SWT.NONE); lblPostgresDirectory.setText("Postgres directory (no bin)"); diff --git a/target/classes/.gitignore b/target/classes/.gitignore index e14721f..3385916 100644 --- a/target/classes/.gitignore +++ b/target/classes/.gitignore @@ -1,2 +1 @@ -/main/ -/images/ +/META-INF/ diff --git a/target/classes/META-INF/maven/com.ccdg.app/MendixBackupRestoreTool/pom.properties b/target/classes/META-INF/maven/com.ccdg.app/MendixBackupRestoreTool/pom.properties index a8aa130..d8ddc81 100644 --- a/target/classes/META-INF/maven/com.ccdg.app/MendixBackupRestoreTool/pom.properties +++ b/target/classes/META-INF/maven/com.ccdg.app/MendixBackupRestoreTool/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Wed Mar 03 11:19:14 CET 2021 +#Sat Mar 06 18:46:22 CET 2021 m2e.projectLocation=C\:\\Users\\Chris de Gelder\\Documents\\GitHub\\BackupRestoreTool\\MendixBackupRestore m2e.projectName=MendixBackupRestoreTool groupId=com.ccdg.app diff --git a/target/classes/images/mendix.png b/target/classes/images/mendix.png new file mode 100644 index 0000000..f8079b7 Binary files /dev/null and b/target/classes/images/mendix.png differ