All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aQute.bnd.connection.settings.SettingsParser Maven / Gradle / Ivy

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