3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
;
13 import org
.eclipse
.core
.runtime
.Platform
;
14 import org
.osgi
.framework
.Bundle
;
16 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
19 * <p>ApplicationUtil class.</p>
22 * @created Oct 13, 2010
25 public class ApplicationUtil
extends AbstractUtility
{
29 * Prefix to declare the version as beta
31 private static final String BETA_PREFIX
= "[BETA]";
36 public static String
getVersion() {
37 Bundle bundle
= Platform
.getBundle("eu.etaxonomy.taxeditor.application");
38 String version
= bundle
.getHeaders().get(org
.osgi
.framework
.Constants
.BUNDLE_VERSION
);
39 // Checking if this is a beta (snapshot) version
40 if(version
==null || version
.isEmpty()) {
43 String
[] parts
= version
.split("\\.");
44 if(parts
.length
<= 3) {
45 // this is a stable version
48 return BETA_PREFIX
+ version
;
56 public static boolean isStable() {
57 return !getVersion().startsWith("[");
62 * @return a {@link java.lang.String} object.
64 public static String
getPluginId(){
65 return TaxonomicEditorPlugin
.PLUGIN_ID
;