public VersionedDependencyId(String groupId, String artifactId, String version, String extension, String classifier) { super(groupId, artifactId, classifier, notEmpty(extension) ? extension : "jar"); this.version = version; }
public VersionedDependencyId(String groupId, String artifactId, String version, String extension, String classifier) { super(groupId, artifactId, classifier, notEmpty(extension) ? extension : "jar"); this.version = version; }
public static String defaultIfEmpty(String value, String defaultValue) { return notEmpty(value) ? value : defaultValue; }
/** * Returns true if the given bundle is a fragment (and so cannot be loaded) */ public static boolean isFragment(Bundle bundle) { return Strings.notEmpty((String) bundle.getHeaders().get(ServiceConstants.INSTR_FRAGMENT_HOST)); } }
/** * Returns true if the given bundle is a fragment (and so cannot be loaded) */ public static boolean isFragment(Bundle bundle) { return Strings.notEmpty((String) bundle.getHeaders().get(ServiceConstants.INSTR_FRAGMENT_HOST)); } }
public Map<VersionedDependencyId, Bundle> getInstalled() { Map<VersionedDependencyId, Bundle> rc = new HashMap<VersionedDependencyId, Bundle>(); for (Bundle bundle : Activator.getInstanceBundleContext().getBundles()) { String value = (String) bundle.getHeaders().get(ServiceConstants.INSTR_FAB_MODULE_ID); if( notEmpty(value) ) { try { rc.put(VersionedDependencyId.fromString(value), bundle); } catch (Throwable e) { } } } return rc; } }
public Map<VersionedDependencyId, Bundle> getInstalled() { Map<VersionedDependencyId, Bundle> rc = new HashMap<VersionedDependencyId, Bundle>(); for (Bundle bundle : Activator.getInstanceBundleContext().getBundles()) { String value = (String) bundle.getHeaders().get(ServiceConstants.INSTR_FAB_MODULE_ID); if( notEmpty(value) ) { try { rc.put(VersionedDependencyId.fromString(value), bundle); } catch (Throwable e) { } } } return rc; } }
@Override public String toVersionRange(String version) { int digits = ServiceConstants.DEFAULT_VERSION_DIGITS; String value = classPathResolver.getManifestProperty(ServiceConstants.INSTR_FAB_VERSION_RANGE_DIGITS); if (notEmpty(value)) { try { digits = Integer.parseInt(value); } catch (NumberFormatException e) { LOG.warn("Failed to parse manifest header " + ServiceConstants.INSTR_FAB_VERSION_RANGE_DIGITS + " as a number. Got: '" + value + "' so ignoring it"); } if (digits < 0 || digits > 4) { LOG.warn("Invalid value of manifest header " + ServiceConstants.INSTR_FAB_VERSION_RANGE_DIGITS + " as value " + digits + " is out of range so ignoring it"); digits = ServiceConstants.DEFAULT_VERSION_DIGITS; } } return Versions.toVersionRange(version, digits); }
public static Service parse(String header) { String[] parts = header.split(";"); Map<String, String> properties = new HashMap<String, String>(); if (parts.length > 1) { for (int i = 1 ; i < parts.length ; i++) { String[] keyvalue = parts[i].split("="); if (keyvalue.length == 2 && Strings.notEmpty(Strings.unquote(keyvalue[1]))) { properties.put(keyvalue[0], Strings.unquote(keyvalue[1])); } } } return new Service(parts[0], properties); }
public static Service parse(String header) { String[] parts = header.split(";"); Map<String, String> properties = new HashMap<String, String>(); if (parts.length > 1) { for (int i = 1 ; i < parts.length ; i++) { String[] keyvalue = parts[i].split("="); if (keyvalue.length == 2 && Strings.notEmpty(Strings.unquote(keyvalue[1]))) { properties.put(keyvalue[0], Strings.unquote(keyvalue[1])); } } } return new Service(parts[0], properties); }
/** * Returns true if this bundle is a bundle fragment */ public boolean isBundleFragment() { return isBundle() && Strings.notEmpty(getManifestEntry("Fragment-Host")); }
@Override public String toString() { String classifier = getClassifier(); String extension = getExtension(); return "DependencyTree(" + getGroupId() + ":" + getArtifactId() + ":" + version + ":" + (notEmpty(classifier) ? ":" + classifier : "") + (notEmpty(extension) ? ":" + extension : "") + children + ")"; }
@Override public String toString() { String classifier = getClassifier(); String extension = getExtension(); return "DependencyTree(" + getGroupId() + ":" + getArtifactId() + ":" + version + ":" + (notEmpty(classifier) ? ":" + classifier : "") + (notEmpty(extension) ? ":" + extension : "") + children + ")"; }
/** * Returns true if this bundle is a bundle fragment */ public boolean isBundleFragment() { return isBundle() && Strings.notEmpty(getManifestEntry("Fragment-Host")); }
@Override public String toString() { return getGroupId() + ":" + getArtifactId() + ":" + getVersion() + ":" + getExtension() + (notEmpty(getClassifier()) ? ":" + getClassifier() : "") ; }
public String getRepositoryPath() { return getGroupId().replace('.', '/')+"/"+getArtifactId()+"/"+getVersion()+"/"+getArtifactId()+"-"+getVersion() + (notEmpty(getClassifier()) ? "-"+getClassifier() : "") + "."+getExtension(); }
public String getRepositoryPath() { return getGroupId().replace('.', '/')+"/"+getArtifactId()+"/"+getVersion()+"/"+getArtifactId()+"-"+getVersion() + (notEmpty(getClassifier()) ? "-"+getClassifier() : "") + "."+getExtension(); }
@Override public String toString() { return getGroupId() + ":" + getArtifactId() + ":" + getVersion() + ":" + getExtension() + (notEmpty(getClassifier()) ? ":" + getClassifier() : "") ; }