/** * We will add all exports to the imports unless there is a -noimport * directive specified on an export. This directive is skipped for the * manifest. * * We also remove any version parameter so that augmentImports can do the * version policy. * */ Map<String, Map<String, String>> addExportsToImports( Map<String, Map<String, String>> exports) { Map<String, Map<String, String>> importsFromExports = newHashMap(); for (Map.Entry<String, Map<String, String>> packageEntry : exports .entrySet()) { String packageName = packageEntry.getKey(); Map<String, String> parameters = packageEntry.getValue(); String noimport = (String) parameters.get(NO_IMPORT_DIRECTIVE); if (noimport == null || !noimport.equalsIgnoreCase("true")) { if (parameters.containsKey(VERSION_ATTRIBUTE)) { parameters = newMap(parameters); parameters.remove(VERSION_ATTRIBUTE); } importsFromExports.put(packageName, parameters); } } return importsFromExports; }
/** * Create the imports/exports by parsing * * @throws IOException */ void analyzeClasspath() throws Exception { classpathExports = newHashMap(); for (Iterator<Jar> c = getClasspath().iterator(); c.hasNext();) { Jar current = c.next(); checkManifest(current); for (Iterator<String> j = current.getDirectories().keySet().iterator(); j.hasNext();) { String dir = j.next(); Resource resource = current.getResource(dir + "/packageinfo"); if (resource != null) { InputStream in = resource.openInputStream(); try { String version = parsePackageInfo(in); setPackageInfo(dir, VERSION_ATTRIBUTE, version); } finally { in.close(); } } } } }
/** * Create the imports/exports by parsing * * @throws IOException */ void analyzeClasspath() throws IOException { classpathExports = newHashMap(); for (Iterator<Jar> c = getClasspath().iterator(); c.hasNext();) { Jar current = c.next(); checkManifest(current); for (Iterator<String> j = current.getDirectories().keySet() .iterator(); j.hasNext();) { String dir = j.next(); Resource resource = current.getResource(dir + "/packageinfo"); if (resource != null) { InputStream in = resource.openInputStream(); try { String version = parsePackageInfo(in); setPackageInfo(dir, "version", version); } finally { in.close(); } } } } }
if (!analyzed) { analyzed = true; classpathExports = newHashMap(); activator = getProperty(BUNDLE_ACTIVATOR); bundleClasspath = parseHeader(getProperty(BUNDLE_CLASSPATH)); Map<String, Map<String, String>> superfluous = newHashMap();
Map<String, Map<String, String>> superfluous = newHashMap();