From f9f7124ed7779e909d0dff1b6a718b126a404735 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 22 Feb 2012 08:11:56 +0000 Subject: [PATCH] * hardcode update revision number (because reading rev from manifest seems to be a very fragile solution) --- source/net/sourceforge/filebot/Settings.java | 20 +++++-------------- .../sourceforge/filebot/Settings.properties | 1 + 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/source/net/sourceforge/filebot/Settings.java b/source/net/sourceforge/filebot/Settings.java index 3dec18ad..772765b6 100644 --- a/source/net/sourceforge/filebot/Settings.java +++ b/source/net/sourceforge/filebot/Settings.java @@ -8,9 +8,6 @@ import java.awt.GraphicsEnvironment; import java.io.File; import java.util.Locale; import java.util.ResourceBundle; -import java.util.jar.Manifest; -import java.util.logging.Level; -import java.util.logging.Logger; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; @@ -33,6 +30,11 @@ public final class Settings { } + public static int getApplicationRevisionNumber() { + return Integer.parseInt(getApplicationProperty("application.revision")); + } + + public static String getApplicationProperty(String key) { return ResourceBundle.getBundle(Settings.class.getName(), Locale.ROOT).getString(key); } @@ -142,18 +144,6 @@ public final class Settings { } - public static int getApplicationRevisionNumber() { - try { - Manifest manifest = new Manifest(Settings.class.getResourceAsStream("/META-INF/MANIFEST.MF")); - String rev = manifest.getMainAttributes().getValue("Built-Revision"); - return Integer.parseInt(rev); - } catch (Exception e) { - Logger.getLogger(Settings.class.getName()).log(Level.WARNING, e.getMessage()); - return 0; - } - } - - public static String getApplicationIdentifier() { return joinBy(" ", getApplicationName(), getApplicationVersion(), String.format("(r%s)", getApplicationRevisionNumber())); } diff --git a/source/net/sourceforge/filebot/Settings.properties b/source/net/sourceforge/filebot/Settings.properties index 4c81f16b..921dd22c 100644 --- a/source/net/sourceforge/filebot/Settings.properties +++ b/source/net/sourceforge/filebot/Settings.properties @@ -1,6 +1,7 @@ # application settings application.name: FileBot application.version: 2.5 +application.revision: 905 # application updates update.url = http://filebot.sourceforge.net/update.xml