throw iae; return Version.parseVersion(version);
/** * Get the bundle version */ public Version getVersion() { return Version.parseVersion(bundleVersion); }
private Version getBundleVersion(Bundle bundle) { Dictionary<?, ?> headers = bundle.getHeaders(); String version = (String) headers.get(Constants.BUNDLE_VERSION); return (version != null) ? Version.parseVersion(version) : Version.emptyVersion; }
private Version getBundleVersion(Bundle bundle) { Dictionary<?, ?> headers = bundle.getHeaders(); String version = (String) headers.get(Constants.BUNDLE_VERSION); return (version != null) ? Version.parseVersion(version) : Version.emptyVersion; }
private Version getBundleVersion(Bundle bundle) { Dictionary<?, ?> headers = bundle.getHeaders(); String version = (String) headers.get(Constants.BUNDLE_VERSION); return (version != null) ? Version.parseVersion(version) : Version.emptyVersion; }
/** * Returns the version of the bundle. * * @since 3.7 */ // TODO e3.5 remove this method and replace with bundle.getVersion() public static Version getVersion(Bundle bundle) { String header = (String) bundle.getHeaders().get("Bundle-Version"); //$NON-NLS-1$ return (header != null) ? Version.parseVersion(header) : null; }
public static Version getBundleVersion(Bundle bundle) { Dictionary<?, ?> headers = bundle.getHeaders(); String version = (String)headers.get(Constants.BUNDLE_VERSION); return (version != null) ? Version.parseVersion(version) : Version.emptyVersion; }
public static Version getBundleVersion(Bundle bundle) { Dictionary<?, ?> headers = bundle.getHeaders(); String version = (String) headers.get(Constants.BUNDLE_VERSION); return (version != null) ? Version.parseVersion(version) : Version.emptyVersion; }
public static Version getBundleVersion(Bundle bundle) { Dictionary headers = bundle.getHeaders(); String version = (String) headers.get(Constants.BUNDLE_VERSION); return (version != null) ? Version.parseVersion(version) : Version.emptyVersion; }
public static Version getBundleVersion(Bundle bundle) { Dictionary headers = bundle.getHeaders(); String version = (String)headers.get(Constants.BUNDLE_VERSION); return (version != null) ? Version.parseVersion(version) : null; }
private static Version toTargetVersion(String target) { String targetAlias = TARGET_ALIASES.get(target.trim().toLowerCase()); if (targetAlias != null) { target = targetAlias; } return Version.parseVersion(target); } }
private void validateOsgiVersionIsValid(final Manifest mf) { final String version = mf.getMainAttributes().getValue(Constants.BUNDLE_VERSION); try { if (Version.parseVersion(version) == Version.emptyVersion) { // we still consider an empty version to be bad throw new IllegalArgumentException(); } } catch (final IllegalArgumentException ex) { throw new IllegalArgumentException("Plugin version '" + version + "' is required and must be able to be " + "parsed as an OSGi version - MAJOR.MINOR.MICRO.QUALIFIER"); } }
protected static Version toVersion(Object object) throws IllegalArgumentException { if (object == null) return null; if (object instanceof Version) return (Version) object; if (object instanceof String) return Version.parseVersion((String) object); throw new IllegalArgumentException(MessageFormat.format("Cannot convert type {0} to Version.", object.getClass() .getName())); }
protected String getHighestVersion(List<String> versions) { String versionName = versions.get(0); Version highest = Version.parseVersion(versionName); for (String currentName : versions) { Version current = Version.parseVersion(currentName); if(current.compareTo(highest)>0) highest = current; } return highest.toString(); }
@Nullable public Version getOsgiVersion() { if (cachedOsgiVersion==null && v!=null) { cachedOsgiVersion = v==null ? null : Version.parseVersion(BrooklynVersionSyntax.toValidOsgiVersion(v)); } return cachedOsgiVersion; }
/** * Get the bundle or composite's version * @return version */ public String getVersion () { String result = String.valueOf(getAttributes().get(Constants.VERSION_ATTRIBUTE)); return Version.parseVersion(result).toString(); }
private Version getExpandedVersion(String versionStr) { Version version = Version.parseVersion( versionStr ); if ( VERSION_QUALIFIER.equals(version.getQualifier()) ) { return new Version(version.getMajor(), version.getMinor(), version.getMicro(), qualifier); } return version; }
public EquinoxServiceDiscoverer(BundleContext context) { this.context = context; Bundle bundle = context.getBundle(); this.version = getSCAVersion(bundle); if (this.version.equals(Version.emptyVersion)) { this.version = Version.parseVersion("1.1"); } bundleTracker = new ActiveBundleTracker(context, false); bundleTracker.open(); tuscanyProviderBundleTracker = new ActiveBundleTracker(context, true); tuscanyProviderBundleTracker.open(); }
private String computeInitialPluginVersion(String pluginVersion) { if (pluginVersion != null && VersionUtil.validateVersion(pluginVersion).isOK()) { Version pvi = Version.parseVersion(pluginVersion); return pvi.getMajor() + "." + pvi.getMinor() //$NON-NLS-1$ + "." + pvi.getMicro(); //$NON-NLS-1$ } return pluginVersion; }
public static String computeInitialPluginVersion(String version) { if (version != null && VersionUtil.validateVersion(version).isOK()) { Version pvi = Version.parseVersion(version); return pvi.getMajor() + "." + pvi.getMinor() //$NON-NLS-1$ + "." + pvi.getMicro(); //$NON-NLS-1$ } return version; }