/** * @since 2.9 */ public String getBundleActivator() { return (String) getMainAttributes().get(BUNDLE_ACTIVATOR); }
/** * @since 2.9 */ public String getBREE() { return (String) getMainAttributes().get(BUNDLE_REQUIRED_EXECUTION_ENV); }
/** * @since 2.9 */ public void setBundleActivator(String activator) { String oldValue = getBundleActivator(); if (Objects.equal(oldValue, activator)) { return; } getMainAttributes().put(BUNDLE_ACTIVATOR, activator); this.modified = true; }
/** * @since 2.9 */ public void setBREE(String bree) { String oldValue = getBREE(); if (Objects.equal(oldValue, bree)) { return; } getMainAttributes().put(BUNDLE_REQUIRED_EXECUTION_ENV, bree); this.modified = true; }
public void addImportedPackages(Set<String> packages) { String s = (String) getMainAttributes().get(IMPORT_PACKAGE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, packages, modified); this.modified = modified.get(); getMainAttributes().put(IMPORT_PACKAGE, result); }
/** * adds the qualified names to the export-package attribute, if not already * present. * * @param packages - passing parameterized packages is not supported */ public void addExportedPackages(Set<String> packages) { String s = (String) getMainAttributes().get(EXPORT_PACKAGE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, packages, modified); this.modified = modified.get(); getMainAttributes().put(EXPORT_PACKAGE, result); }
@Override public void write(OutputStream out) throws IOException { DataOutputStream dos = new DataOutputStream(out); // Write out the main attributes for the manifest getMainAttributes().myWriteMain(dos); // Now write out the pre-entry attributes Iterator<Map.Entry<String, Attributes>> it = getEntries().entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, Attributes> e = it.next(); StringBuffer buffer = new StringBuffer("Name: "); String value = e.getKey(); if (value != null) { byte[] vb = value.getBytes("UTF8"); value = new String(vb, 0, 0, vb.length); } buffer.append(value); buffer.append(lineDelimiter); dos.writeBytes(make512Safe(buffer, lineDelimiter)); ((OrderAwareAttributes) e.getValue()).myWrite(dos); } dos.flush(); }
/** * adds the qualified names to the require-bundle attribute, if not already * present. * * @param bundles - passing parameterized bundled (e.g. versions, etc.) is not supported */ public void addRequiredBundles(Set<String> bundles) { // TODO manage transitive dependencies // don't require self Set<String> bundlesToMerge; String bundleName = (String) getMainAttributes().get(BUNDLE_NAME); if (bundleName != null && bundles.contains(bundleName) || projectName != null && bundles.contains(projectName)) { bundlesToMerge = new LinkedHashSet<String>(bundles); bundlesToMerge.remove(bundleName); bundlesToMerge.remove(projectName); } else { bundlesToMerge = bundles; } String s = (String) getMainAttributes().get(REQUIRE_BUNDLE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, bundlesToMerge, modified); this.modified = modified.get(); getMainAttributes().put(REQUIRE_BUNDLE, result); }
@SuppressWarnings("deprecation") @Override public void write(OutputStream out) throws IOException { DataOutputStream dos = new DataOutputStream(out); // Write out the main attributes for the manifest ((OrderAwareAttributes) getMainAttributes()).myWriteMain(dos); // Now write out the pre-entry attributes Iterator<Map.Entry<String, Attributes>> it = getEntries().entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, Attributes> e = it.next(); StringBuffer buffer = new StringBuffer("Name: "); String value = e.getKey(); if (value != null) { byte[] vb = value.getBytes("UTF8"); value = new String(vb, 0, 0, vb.length); } buffer.append(value); buffer.append("\r\n"); dos.writeBytes(make512Safe(buffer)); ((OrderAwareAttributes) e.getValue()).myWrite(dos); } dos.flush(); }
public void addImportedPackages(Set<String> packages) { String s = (String) getMainAttributes().get(IMPORT_PACKAGE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, packages, modified, lineDelimiter); this.modified = modified.get(); getMainAttributes().put(IMPORT_PACKAGE, result); }
String bundleName = (String) getMainAttributes().get(BUNDLE_SYMBOLIC_NAME); if (bundleName != null) { int idx = bundleName.indexOf(';'); bundlesToMerge = bundles; String s = (String) getMainAttributes().get(REQUIRE_BUNDLE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, bundlesToMerge, modified, lineDelimiter); this.modified = modified.get(); getMainAttributes().put(REQUIRE_BUNDLE, result);
/** * adds the qualified names to the export-package attribute, if not already * present. * * @param packages - passing parameterized packages is not supported */ public void addExportedPackages(Set<String> packages) { String s = (String) getMainAttributes().get(EXPORT_PACKAGE); Wrapper<Boolean> modified = Wrapper.wrap(this.modified); String result = mergeIntoCommaSeparatedList(s, packages, modified, lineDelimiter); this.modified = modified.get(); getMainAttributes().put(EXPORT_PACKAGE, result); }