blob: 1f26505ededd1903649423bedd142172c704ee7e (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
package com.btr.proxy.search.desktop.win;
import java.net.ProxySelector;
import com.btr.proxy.search.ProxySearchStrategy;
import com.btr.proxy.search.browser.ie.IEProxySearchStrategy;
import com.btr.proxy.util.ProxyException;
/*****************************************************************************
* Extracts the proxy settings from the windows registry.
* This will read the windows system proxy settings.
*
* @author Bernd Rosstauscher (proxyvole@rosstauscher.de) Copyright 2009
****************************************************************************/
public class WinProxySearchStrategy implements ProxySearchStrategy {
/*************************************************************************
* Constructor
************************************************************************/
public WinProxySearchStrategy() {
super();
}
/*************************************************************************
* getProxySelector
* @see com.btr.proxy.search.ProxySearchStrategy#getProxySelector()
************************************************************************/
public ProxySelector getProxySelector() throws ProxyException {
// TODO Rossi 08.05.2009 Implement this by using Win API calls.
// new Win32ProxyUtils().winHttpGetDefaultProxyConfiguration()
// Current fallback is to use the IE settings. This is better
// because the registry settings are most of the time not set.
// Some Windows server installations may use it though.
return new IEProxySearchStrategy().getProxySelector();
}
/*************************************************************************
* Loads the settings.
* @return a WinIESettings object containing all proxy settings.
************************************************************************/
public Win32IESettings readSettings() {
return new IEProxySearchStrategy().readSettings();
}
}
|