
aQute.bnd.connection.settings.SettingsParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biz.aQute.bndlib Show documentation
Show all versions of biz.aQute.bndlib Show documentation
bndlib: A Swiss Army Knife for OSGi
The newest version!
package aQute.bnd.connection.settings;
import java.io.File;
import aQute.bnd.osgi.Macro;
import aQute.bnd.osgi.Processor;
import aQute.lib.xpath.XPathParser;
public class SettingsParser extends XPathParser {
final SettingsDTO settings = new SettingsDTO();
@SuppressWarnings("resource")
private final Macro replacer = new Processor().getReplacer();
/*
* example-proxy true
* http proxy.example.com
* 8080 proxyuser
* somepassword
* www.google.com|*.example.com
*
*/
public SettingsParser(File file) throws Exception {
super(file);
parse("/settings/proxies/proxy", ProxyDTO.class, settings.proxies);
parse("/settings/servers/server", ServerDTO.class, settings.servers);
}
public SettingsDTO getSettings() {
return settings;
}
@Override
protected String processValue(String value) {
return replacer.process(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy