* hardcode update revision number (because reading rev from manifest seems to be a very fragile solution)

This commit is contained in:
Reinhard Pointner 2012-02-22 08:11:56 +00:00
parent 5e2926bed5
commit f9f7124ed7
2 changed files with 6 additions and 15 deletions

View File

@ -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()));
}

View File

@ -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