X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2FVersion.java;h=613fcfe54130ef04d4df068091d7e52a26879002;hb=b0376a373cca5505d0ab5c620aec7821b8fe3064;hp=550c5e9dfc156f2e11b30b9d461955ee3d6e6ee3;hpb=32ae20790403c7bce40bf278db8ca0258623945c;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/Version.java b/src/be/nikiroo/utils/Version.java index 550c5e9..613fcfe 100644 --- a/src/be/nikiroo/utils/Version.java +++ b/src/be/nikiroo/utils/Version.java @@ -40,16 +40,17 @@ public class Version { * the version (MAJOR.MINOR.PATCH) */ public Version(String version) { - this.version = version; try { String[] tab = version.split("\\."); this.major = Integer.parseInt(tab[0]); this.minor = Integer.parseInt(tab[1]); this.patch = Integer.parseInt(tab[2]); + this.version = version; } catch (Exception e) { this.major = 0; this.minor = 0; this.patch = 0; + this.version = null; } } @@ -112,7 +113,7 @@ public class Version { * @return the {@link Version} of the program, or an empty {@link Version} * (does not return NULL) */ - public static String getCurrentVersion() { + public static Version getCurrentVersion() { String version = null; InputStream in = IOUtils.openResource("VERSION"); @@ -127,7 +128,7 @@ public class Version { } } - return version; + return new Version(version); } /**