Skip to main content
summaryrefslogtreecommitdiffstats
blob: e68b2a149cab0b4d89540e117467e075690d7d2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*******************************************************************************
 * Copyright (c) 2003, 2007 Mylyn project committers and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package org.eclipse.mylyn.internal.bugzilla.core;

import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Steffen Pingel
 * @author Robert Elves (adaption for Bugzilla)
 */
public class BugzillaClientFactory {

	public static BugzillaClient createClient(String hostUrl, String username, String password, String htAuthUser,
			String htAuthPass, Proxy proxy, String encoding) throws MalformedURLException {
		return createClient(hostUrl, username, password, htAuthUser, htAuthPass, proxy, encoding,
				new HashMap<String, String>());
	}

	public static BugzillaClient createClient(String hostUrl, String username, String password, String htAuthUser,
			String htAuthPass, Proxy proxy, String encoding, Map<String, String> configParameters)
			throws MalformedURLException {
		URL url = new URL(hostUrl);

		BugzillaClient client = new BugzillaClient(url, username, password, htAuthUser, htAuthPass, encoding,
				configParameters);
		client.setProxy(proxy);
		return client;
	}
}

Back to the top