private static synchronized String getSymbolicName(String path) { if (fCachedLocations == null) fCachedLocations = new HashMap(); File file = new File(path); if (file.exists() && !fCachedLocations.containsKey(path)) { try { Dictionary dictionary = MinimalState.loadManifest(file); String value = (String) dictionary.get(Constants.BUNDLE_SYMBOLICNAME); if (value != null) { ManifestElement[] elements = ManifestElement.parseHeader(Constants.BUNDLE_SYMBOLICNAME, value); String id = elements.length > 0 ? elements[0].getValue() : null; if (id != null) fCachedLocations.put(path, elements[0].getValue()); } } catch (IOException e) { } catch (BundleException e) { } } return (String) fCachedLocations.get(path); }
public static Dictionary getTargetEnvironment(MinimalState state) { Dictionary result = getTargetEnvironment(); result.put(ICoreConstants.OSGI_SYSTEM_BUNDLE, state.getSystemBundle()); return result; }