Skip to content

Instantly share code, notes, and snippets.

@anpieber
Created April 11, 2011 07:39
Show Gist options
  • Save anpieber/913199 to your computer and use it in GitHub Desktop.
Save anpieber/913199 to your computer and use it in GitHub Desktop.
for (String config : feature.getConfigurations().keySet()) {
Dictionary<String,String> props = new Hashtable<String, String>(feature.getConfigurations().get(config));
String[] pid = parsePid(config);
Configuration cfg = findExistingConfiguration(configAdmin, pid[0], pid[1]);
if (cfg == null) {
cfg = createConfiguration(configAdmin, pid[0], pid[1]);
String key = (pid[1] == null ? pid[0] : pid[0] + "-" + pid[1]);
props.put(CONFIG_KEY, key);
if (cfg.getBundleLocation() != null) {
cfg.setBundleLocation(null);
}
cfg.update(props);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment