2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.util
;
12 import org
.eclipse
.core
.runtime
.Platform
;
13 import org
.osgi
.framework
.Bundle
;
15 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
18 * <p>ApplicationUtil class.</p>
21 * @created Oct 13, 2010
24 public class ApplicationUtil
extends AbstractUtility
{
28 * Prefix to declare the version as beta
30 private static final String BETA_PREFIX
= "[BETA]";
32 public static String
getTitle() {
33 return "EDIT Taxonomic Editor " + ApplicationUtil
.getVersion();
38 public static String
getVersion() {
39 Bundle bundle
= Platform
.getBundle("eu.etaxonomy.taxeditor.application");
40 String version
= bundle
.getHeaders().get(org
.osgi
.framework
.Constants
.BUNDLE_VERSION
);
41 // Checking if this is a beta (snapshot) version
42 if(version
==null || version
.isEmpty()) {
45 String
[] parts
= version
.split("\\.");
46 if(parts
.length
<= 3) {
47 // this is a stable version
50 return BETA_PREFIX
+ " " + version
+ " UTC";
58 public static boolean isStable() {
59 return !getVersion().startsWith(BETA_PREFIX
);