summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/pom.xml2
-rw-r--r--utils/src/main/java/at/gv/egiz/updater/Constants.java12
-rw-r--r--utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java21
-rw-r--r--utils/src/main/java/at/gv/egiz/updater/NewVersionDialog.java2
4 files changed, 24 insertions, 13 deletions
diff --git a/utils/pom.xml b/utils/pom.xml
index 3e3c4f5a..ab221f16 100644
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -2,7 +2,7 @@
<parent>
<artifactId>mocca</artifactId>
<groupId>at.gv.egiz</groupId>
- <version>1.4.2-SNAPSHOT</version>
+ <version>1.4.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>utils</artifactId>
diff --git a/utils/src/main/java/at/gv/egiz/updater/Constants.java b/utils/src/main/java/at/gv/egiz/updater/Constants.java
index 89a75ee0..60b914c2 100644
--- a/utils/src/main/java/at/gv/egiz/updater/Constants.java
+++ b/utils/src/main/java/at/gv/egiz/updater/Constants.java
@@ -24,9 +24,13 @@ package at.gv.egiz.updater;
public class Constants {
- public static final String WEBSTART_URL = "https://webstart.buergerkarte.at/";
- public static final String MOCCA_STR = "mocca/";
- public static final String VERSION_FILE = "Release.txt";
- public static final String PATH_TO_VERSION_FILE = WEBSTART_URL + MOCCA_STR + VERSION_FILE;
+ //public static final String WEBSTART_URL = "https://webstart.buergerkarte.at/";
+ //public static final String MOCCA_STR = "mocca/";
+ //public static final String VERSION_FILE = "Release.txt";
+ //public static final String PATH_TO_VERSION_FILE = WEBSTART_URL + MOCCA_STR + VERSION_FILE;
+ public static final String DOWNLOAD_URL = "https://technology.a-sit.at/en/mocca/";
+ public static final String VERSION_FILE_URL = "https://updates.a-sit.at/mocca/Release.txt";
+
+
}
diff --git a/utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java b/utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java
index ad8f8d84..25927900 100644
--- a/utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java
+++ b/utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java
@@ -70,19 +70,24 @@ public class MoccaUpdater {
return;
}
- gatherOnlineMoccaVersion();
- boolean isOnlineNewer = isOnlineVersionNewer();
- if (isOnlineNewer) {
- notifyUserNewerVersionOnline();
+ try {
+ gatherOnlineMoccaVersion();
+ boolean isOnlineNewer = isOnlineVersionNewer();
+ if (isOnlineNewer) {
+ notifyUserNewerVersionOnline();
+ }
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ log.error(e.getMessage());
}
}
- private void gatherOnlineMoccaVersion() {
+ private void gatherOnlineMoccaVersion() throws Exception {
try {
log.info("Requesting Mocca Online Version");
- URL url = new URL(Constants.PATH_TO_VERSION_FILE);
- log.debug("Going to GET mocca Version from: " + Constants.PATH_TO_VERSION_FILE);
+ URL url = new URL(Constants.VERSION_FILE_URL);
+ log.debug("Going to GET mocca Version from: " + Constants.VERSION_FILE_URL);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
@@ -96,6 +101,7 @@ public class MoccaUpdater {
log.info("Online Mocca Version: " + result.toString());
} catch (IOException e) {
log.error("Error when gathering Mocca Online Version " + e.getMessage());
+ throw new Exception("Error gathering Mocca Version number from Website ");
}
}
@@ -113,6 +119,7 @@ public class MoccaUpdater {
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
+ System.err.print(e.getMessage());
log.error(e.getMessage());
}
diff --git a/utils/src/main/java/at/gv/egiz/updater/NewVersionDialog.java b/utils/src/main/java/at/gv/egiz/updater/NewVersionDialog.java
index 674d8339..64cef7f4 100644
--- a/utils/src/main/java/at/gv/egiz/updater/NewVersionDialog.java
+++ b/utils/src/main/java/at/gv/egiz/updater/NewVersionDialog.java
@@ -165,7 +165,7 @@ public class NewVersionDialog extends JDialog {
private void openLink() {
if (Desktop.isDesktopSupported()) {
try {
- Desktop.getDesktop().browse(new URI(Constants.WEBSTART_URL+Constants.MOCCA_STR));
+ Desktop.getDesktop().browse(new URI(Constants.DOWNLOAD_URL));
} catch (IOException | URISyntaxException e) {
log.error(e.getMessage());
}