Lines 64-69
Link Here
|
64 |
private static final Logger LOGGER = Logger.getLogger(RemoteUtils.class.getName()); |
64 |
private static final Logger LOGGER = Logger.getLogger(RemoteUtils.class.getName()); |
65 |
|
65 |
|
66 |
private static final URI URI_FOR_HTTP_PROXY = URI.create("http://oracle.com"); // NOI18N |
66 |
private static final URI URI_FOR_HTTP_PROXY = URI.create("http://oracle.com"); // NOI18N |
|
|
67 |
private static final URI URI_FOR_SOCKS_PROXY = URI.create("socks://oracle.com"); // NOI18N |
67 |
|
68 |
|
68 |
|
69 |
|
69 |
private RemoteUtils() { |
70 |
private RemoteUtils() { |
Lines 184-204
Link Here
|
184 |
} |
185 |
} |
185 |
|
186 |
|
186 |
@CheckForNull |
187 |
@CheckForNull |
187 |
public static HttpProxyInfo getHttpProxy() { |
188 |
public static ProxyInfo getHttpProxy() { |
188 |
String proxyHost = NetworkSettings.getProxyHost(URI_FOR_HTTP_PROXY); |
189 |
String proxyHost = NetworkSettings.getProxyHost(URI_FOR_HTTP_PROXY); |
189 |
if (proxyHost == null) { |
190 |
if (proxyHost == null) { |
190 |
// no proxy |
191 |
// no proxy |
191 |
return null; |
192 |
return null; |
192 |
} |
193 |
} |
193 |
return new HttpProxyInfo(proxyHost, |
194 |
return new ProxyInfo(proxyHost, |
194 |
Integer.parseInt(NetworkSettings.getProxyPort(URI_FOR_HTTP_PROXY)), |
195 |
Integer.parseInt(NetworkSettings.getProxyPort(URI_FOR_HTTP_PROXY)), |
195 |
NetworkSettings.getAuthenticationUsername(URI_FOR_HTTP_PROXY), |
196 |
NetworkSettings.getAuthenticationUsername(URI_FOR_HTTP_PROXY), |
196 |
NetworkSettings.getKeyForAuthenticationPassword(URI_FOR_HTTP_PROXY)); |
197 |
NetworkSettings.getKeyForAuthenticationPassword(URI_FOR_HTTP_PROXY)); |
197 |
} |
198 |
} |
198 |
|
199 |
|
|
|
200 |
@CheckForNull |
201 |
public static ProxyInfo getSocksProxy() { |
202 |
String proxyHost = NetworkSettings.getProxyHost(URI_FOR_SOCKS_PROXY); |
203 |
if (proxyHost == null) { |
204 |
// no proxy |
205 |
return null; |
206 |
} |
207 |
return new ProxyInfo(proxyHost, |
208 |
Integer.parseInt(NetworkSettings.getProxyPort(URI_FOR_SOCKS_PROXY)), |
209 |
NetworkSettings.getAuthenticationUsername(URI_FOR_SOCKS_PROXY), |
210 |
NetworkSettings.getKeyForAuthenticationPassword(URI_FOR_SOCKS_PROXY)); |
211 |
} |
212 |
|
199 |
//~ Inner classes |
213 |
//~ Inner classes |
200 |
|
214 |
|
201 |
public static final class HttpProxyInfo { |
215 |
public static final class ProxyInfo { |
202 |
|
216 |
|
203 |
private final String host; |
217 |
private final String host; |
204 |
private final int port; |
218 |
private final int port; |
Lines 206-212
Link Here
|
206 |
private final String passwordKey; |
220 |
private final String passwordKey; |
207 |
|
221 |
|
208 |
|
222 |
|
209 |
public HttpProxyInfo(String host, int port, String username, String passwordKey) { |
223 |
public ProxyInfo(String host, int port, String username, String passwordKey) { |
210 |
this.host = host; |
224 |
this.host = host; |
211 |
this.port = port; |
225 |
this.port = port; |
212 |
this.username = username; |
226 |
this.username = username; |